[dev.ssa] cmd/compile: getg needs a memory arg

getg reads from memory, so it should really have a
memory arg.  It is critical in functions which call setg
to make sure getg gets ordered correctly with setg.

Change-Id: Ief4875421f741fc49c07b0e1f065ce2535232341
Reviewed-on: https://go-review.googlesource.com/16100
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
This commit is contained in:
Keith Randall 2015-10-19 18:54:40 -07:00
parent 65df9c4c2b
commit d694f83c21
8 changed files with 16 additions and 19 deletions

View file

@ -1697,16 +1697,16 @@ func rewriteValuegeneric(v *Value, config *Config) bool {
func rewriteBlockgeneric(b *Block) bool {
switch b.Kind {
case BlockIf:
// match: (If (IsNonNil (GetG)) yes no)
// match: (If (IsNonNil (GetG _)) yes no)
// cond:
// result: (First nil yes no)
{
v := b.Control
if v.Op != OpIsNonNil {
goto endafdc4e2525f9933ab0ae7effc3559597
goto end41b95d88b4cebdb0ce392bd3c1c89e95
}
if v.Args[0].Op != OpGetG {
goto endafdc4e2525f9933ab0ae7effc3559597
goto end41b95d88b4cebdb0ce392bd3c1c89e95
}
yes := b.Succs[0]
no := b.Succs[1]
@ -1716,8 +1716,8 @@ func rewriteBlockgeneric(b *Block) bool {
b.Succs[1] = no
return true
}
goto endafdc4e2525f9933ab0ae7effc3559597
endafdc4e2525f9933ab0ae7effc3559597:
goto end41b95d88b4cebdb0ce392bd3c1c89e95
end41b95d88b4cebdb0ce392bd3c1c89e95:
;
// match: (If (Not cond) yes no)
// cond: