cmd/compile: On PPC, nilcheck load should be MOVBZ

There's no load-signed-byte on PPC, so MOVB
causes the assembler to macro-expand in a
useless sign extension.

Fixes #17211.

Change-Id: Ibcd73aea4c94ba6df0a998b0091e45508113be2a
Reviewed-on: https://go-review.googlesource.com/29762
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Munday <munday@ca.ibm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
David Chase 2016-09-26 08:32:49 -07:00
parent 375092bdcb
commit 1906d93bfd

View file

@ -813,7 +813,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
case ssa.OpPPC64LoweredNilCheck:
// Issue a load which will fault if arg is nil.
p := gc.Prog(ppc64.AMOVB)
p := gc.Prog(ppc64.AMOVBZ)
p.From.Type = obj.TYPE_MEM
p.From.Reg = v.Args[0].Reg()
gc.AddAux(&p.From, v)