]> Cypherpunks repositories - gostls13.git/commit
[dev.power64] 9g: fix nilopt
authorAustin Clements <austin@google.com>
Mon, 3 Nov 2014 20:48:51 +0000 (15:48 -0500)
committerAustin Clements <austin@google.com>
Mon, 3 Nov 2014 20:48:51 +0000 (15:48 -0500)
commit810019286fdb8ad6b60096f2b0e2dcf0bc900c3a
treeb59e71965ef5f5e9f2ba3fc023246da16dc71a67
parent31b1207fde70531cd5092d83c01ad5e0f07eb951
[dev.power64] 9g: fix nilopt

Previously, nilopt was disabled on power64x because it threw
away "seemly random segments of code."  Indeed, excise on
power64x failed to preserve the link field, so it excised not
only the requested instruction but all following instructions
in the function.  Fix excise to retain the link field while
otherwise zeroing the instruction.

This makes nilopt safe on power64x.  It still fails
nilptr3.go's tests for removal of repeated nil checks because
those depend on also optimizing away repeated loads, which
doesn't currently happen on power64x.

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/168120043
src/cmd/9g/peep.c
src/cmd/gc/popt.c