https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80453
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- So the issue is that vn_phi_eq depends on cond_stmts_equal_p which may change if we value-number the controlling condition after the PHI itself which can trivially happen with SCC based value-numbering as controlling conditions are not part of the SCC. Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (revision 246964) +++ gcc/tree-ssa-sccvn.c (working copy) @@ -2941,10 +2941,12 @@ cond_stmts_equal_p (gcond *cond1, gcond else return false; +#if 0 lhs1 = vn_valueize (lhs1); rhs1 = vn_valueize (rhs1); lhs2 = vn_valueize (lhs2); rhs2 = vn_valueize (rhs2); +#endif return ((expressions_equal_p (lhs1, lhs2) && expressions_equal_p (rhs1, rhs2)) || (commutative_tree_code (code1) would fix this (and pessimize PHI VN of course).