From: Keith Randall Date: Mon, 31 Dec 2018 23:03:33 +0000 (-0800) Subject: cmd/compile: fix no-op instruction used by s390x X-Git-Tag: go1.12beta2~51 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=abd1dde1f717f86f94774ce9ab56053947f2d175;p=gostls13.git cmd/compile: fix no-op instruction used by s390x CL 152537 introduced a new use for ginsnop, the arch-dependent routine that generates nops. The previous s390x nop clobbered flags. It turns out the previous uses of this nop did not require flags to be preserved, but the new use does. Use a real nop: the 4-byte preferred nop. Fixes #29453 Change-Id: I95310dfdd831932e26f5d5b6608324687f4c3162 Reviewed-on: https://go-review.googlesource.com/c/155926 Reviewed-by: Michael Munday --- diff --git a/src/cmd/compile/internal/s390x/ggen.go b/src/cmd/compile/internal/s390x/ggen.go index ba5f2dfc2b..6a72b27ac5 100644 --- a/src/cmd/compile/internal/s390x/ggen.go +++ b/src/cmd/compile/internal/s390x/ggen.go @@ -105,10 +105,8 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } func ginsnop(pp *gc.Progs) *obj.Prog { - p := pp.Prog(s390x.AOR) - p.From.Type = obj.TYPE_REG - p.From.Reg = int16(s390x.REG_R0) - p.To.Type = obj.TYPE_REG - p.To.Reg = int16(s390x.REG_R0) + p := pp.Prog(s390x.AWORD) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 0x47000000 // nop 0 return p }