Skip to content

Commit abd1dde

Browse files
committed
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 <[email protected]>
1 parent 0175064 commit abd1dde

File tree

1 file changed

+3
-5
lines changed
  • src/cmd/compile/internal/s390x

1 file changed

+3
-5
lines changed

src/cmd/compile/internal/s390x/ggen.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) {
105105
}
106106

107107
func ginsnop(pp *gc.Progs) *obj.Prog {
108-
p := pp.Prog(s390x.AOR)
109-
p.From.Type = obj.TYPE_REG
110-
p.From.Reg = int16(s390x.REG_R0)
111-
p.To.Type = obj.TYPE_REG
112-
p.To.Reg = int16(s390x.REG_R0)
108+
p := pp.Prog(s390x.AWORD)
109+
p.From.Type = obj.TYPE_CONST
110+
p.From.Offset = 0x47000000 // nop 0
113111
return p
114112
}

0 commit comments

Comments
 (0)