[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>
diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go
index 7219ffd..3ef8232 100644
--- a/src/cmd/compile/internal/gc/ssa.go
+++ b/src/cmd/compile/internal/gc/ssa.go
@@ -1870,7 +1870,7 @@
return s.call(n, callNormal)
case OGETG:
- return s.newValue0(ssa.OpGetG, n.Type)
+ return s.newValue1(ssa.OpGetG, n.Type, s.mem())
case OAPPEND:
// append(s, e1, e2, e3). Compile like: