]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: stop rematerializable ops from clobbering flags
authorMichael Munday <mike.munday@ibm.com>
Mon, 11 Sep 2017 20:23:06 +0000 (21:23 +0100)
committerMichael Munday <mike.munday@ibm.com>
Wed, 20 Sep 2017 17:10:58 +0000 (17:10 +0000)
commit2cb61aa3f77e05f265ccacebf48c2ebf53de1494
tree76efe0407849d0d41054a9e9b6715929fb526f36
parent3628c2d52f14c1e4dfa0df264086dd55b21a8f44
cmd/compile: stop rematerializable ops from clobbering flags

Rematerializable ops can be inserted after the flagalloc phase,
they must therefore not clobber flags. This CL adds a check to
ensure this doesn't happen and fixes the instances where it
does currently.

amd64: ADDQconst and ADDLconst were recently changed to be
rematerializable in CL 54393 (only in tip, not 1.9). That change
has been reverted.

s390x: MOVDaddr could clobber flags when using dynamic linking due
to a ADD with immediate instruction. Change the code generation to
use LA/LAY instead.

Fixes #21080.

Change-Id: Ia85c882afa2a820a309e93775354b3169ec6d034
Reviewed-on: https://go-review.googlesource.com/63030
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/S390XOps.go
src/cmd/compile/internal/ssa/gen/main.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/internal/obj/s390x/objz.go