]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.16] cmd/compile: disable shortcircuit optimization for intertwine...
authorKeith Randall <khr@golang.org>
Tue, 23 Mar 2021 21:48:47 +0000 (14:48 -0700)
committerDavid Chase <drchase@google.com>
Wed, 31 Mar 2021 14:33:46 +0000 (14:33 +0000)
commit3a45c13094e2bf1ac1430ce6af8b8be80bf0938e
tree92d129cb6161c3df5db0be22fd68f669d66230ea
parent2940614c63ed1351c47038db4ec613a37d1e72fd
[release-branch.go1.16] cmd/compile: disable shortcircuit optimization for intertwined phi values

We need to be careful that when doing value graph surgery, we not
re-substitute a value that has already been substituted. That can lead
to confusing a previous iteration's value with the current iteration's
value.

The simple fix in this CL just aborts the optimization if it detects
intertwined phis (a phi which is the argument to another phi). It
might be possible to keep the optimization with a more complicated
CL, but:
  1) This CL is clearly safe to backport.
  2) There were no instances of this abort triggering in
     all.bash, prior to the test introduced in this CL.

Fixes #45192

Change-Id: I2411dca03948653c053291f6829a76bec0c32330
Reviewed-on: https://go-review.googlesource.com/c/go/+/304251
Trust: Keith Randall <khr@golang.org>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
(cherry picked from commit 771c57e68ed5ef2bbb0eafc0d48419f59d143932)
Reviewed-on: https://go-review.googlesource.com/c/go/+/304530
src/cmd/compile/internal/ssa/shortcircuit.go
test/fixedbugs/issue45175.go [new file with mode: 0644]