diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-12-05 18:56:54 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2019-12-06 00:57:11 +0000 |
commit | 7673884a7fe831ab8b8cf43a3ae74e12c9a44fbf (patch) | |
tree | 6f7f7c31f8c62ef31a33d19d45f8243b697eabfa /src/cmd/compile/internal/ssa/opGen.go | |
parent | eeb319a5a5c9f1ef7e31c551b03ec841ee9f0b61 (diff) | |
download | go-7673884a7fe831ab8b8cf43a3ae74e12c9a44fbf.tar.gz go-7673884a7fe831ab8b8cf43a3ae74e12c9a44fbf.zip |
cmd/compile: don't fuse branches with side effects
Count Values with side effects but no use as live, and don't fuse
branches that contain such Values. (This can happen e.g. when it
is followed by an infinite loop.) Otherwise this may lead to
miscompilation (side effect fired at wrong condition) or ICE (two
stores live simultaneously).
Fixes #36005.
Change-Id: If202eae4b37cb7f0311d6ca120ffa46609925157
Reviewed-on: https://go-review.googlesource.com/c/go/+/210179
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/opGen.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/opGen.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go index a5951dd4e1..99dc60640c 100644 --- a/src/cmd/compile/internal/ssa/opGen.go +++ b/src/cmd/compile/internal/ssa/opGen.go @@ -31636,6 +31636,7 @@ func (o Op) String() string { return opcodeTable[o].name } func (o Op) UsesScratch() bool { return opcodeTable[o].usesScratch } func (o Op) SymEffect() SymEffect { return opcodeTable[o].symEffect } func (o Op) IsCall() bool { return opcodeTable[o].call } +func (o Op) HasSideEffects() bool { return opcodeTable[o].hasSideEffects } func (o Op) UnsafePoint() bool { return opcodeTable[o].unsafePoint } var registers386 = [...]Register{ |