]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't fuse branches with side effects
authorCherry Zhang <cherryyz@google.com>
Thu, 5 Dec 2019 23:56:54 +0000 (18:56 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 6 Dec 2019 00:57:11 +0000 (00:57 +0000)
commit7673884a7fe831ab8b8cf43a3ae74e12c9a44fbf
tree6f7f7c31f8c62ef31a33d19d45f8243b697eabfa
parenteeb319a5a5c9f1ef7e31c551b03ec841ee9f0b61
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>
src/cmd/compile/internal/ssa/fuse.go
src/cmd/compile/internal/ssa/fuse_test.go
src/cmd/compile/internal/ssa/gen/main.go
src/cmd/compile/internal/ssa/opGen.go