Commit 2dc88eea authored by Keith Randall's avatar Keith Randall Committed by David Chase

[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/16095Reviewed-by: 's avatarTodd Neal <todd@tneal.org>
parent c64a6f63
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment