https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99694
--- Comment #4 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:b931e4792b8696f3da69f70988720c4d1ec6142a commit r11-7762-gb931e4792b8696f3da69f70988720c4d1ec6142a 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.