https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99694
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:73d1e612011f1781275c7504c4fa5c365c0c3ddd commit r10-9525-g73d1e612011f1781275c7504c4fa5c365c0c3ddd 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)