mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: Don't rematerialize getg
It isn't safe in functions that also call setg. Change-Id: I76a7bf0401b4b6c8a129c245b15a2d6f06080e94 Reviewed-on: https://go-review.googlesource.com/16095 Reviewed-by: Todd Neal <todd@tneal.org>
This commit is contained in:
parent
c64a6f6362
commit
2dc88eead8
1 changed files with 5 additions and 1 deletions
|
|
@ -982,7 +982,11 @@ func (v *Value) rematerializeable() bool {
|
|||
// which can't be moved.
|
||||
return false
|
||||
}
|
||||
// TODO: maybe not OpAMD64LoweredGetG?
|
||||
if v.Op == OpAMD64LoweredGetG {
|
||||
// It would almost always be ok to rematerialize this op.
|
||||
// The annoying exception is functions that call runtime.setg.
|
||||
return false
|
||||
}
|
||||
if len(v.Args) == 0 {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue