https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99694
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:a343b3bda748c2eb602d4e7de17d827a5912c53b commit r9-9343-ga343b3bda748c2eb602d4e7de17d827a5912c53b Author: Richard Biener <rguent...@suse.de> Date: Mon Mar 22 11:09:46 2021 +0100 tree-optimization/99694 - fix value-numbering PHIs This avoids endless cycling when a PHI node with unchanged backedge value (the PHI result appearing there) is subject to CSE since doing that effectively alters the hash entry. The way to avoid this is to ignore such edges when processing the PHI node. 2021-03-22 Richard Biener <rguent...@suse.de> PR tree-optimization/99694 * tree-ssa-sccvn.c (visit_phi): Ignore edges with the PHI result. * gcc.dg/torture/pr99694.c: New testcase. (cherry picked from commit b931e4792b8696f3da69f70988720c4d1ec6142a)