tree-optimization/108523 - fix endless iteration in VN
authorRichard Biener <rguenther@suse.de>
Wed, 25 Jan 2023 12:31:46 +0000 (13:31 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 25 Jan 2023 12:37:23 +0000 (13:37 +0100)
commitc29d85359add807200a1a851026b4e4a9d6b714c
tree145ca6779497b995647b3e4786414b3df9406b5a
parent64f66385086e6a957c337eef97aec01cf30c162d
tree-optimization/108523 - fix endless iteration in VN

The following fixes not converging iteration in value-numbering of
PHI nodes when we use an equivalence to prove the PHI node is
degenerate.  We have to avoid the situation where we oscillate
between the two equivalent values because the result is fed back
via a backedge.

PR tree-optimization/108523
* tree-ssa-sccvn.cc (visit_phi): Avoid using the exclusive
backedge value for the result when using predication to
prove equivalence.
gcc/tree-ssa-sccvn.cc