https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108523
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:c29d85359add807200a1a851026b4e4a9d6b714c commit r13-5348-gc29d85359add807200a1a851026b4e4a9d6b714c Author: Richard Biener <rguent...@suse.de> Date: Wed Jan 25 13:31:46 2023 +0100 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.