https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119470
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2025-03-26 Keywords| |missed-optimization --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- In VRP1 we have: ``` <bb 3> [local count: 955630224]: _1 = inc (i_5); _2 = i_5 + 1; if (_1 != _2) goto <bb 4>; [0.00%] else goto <bb 5>; [100.00%] <bb 4> [count: 0]: __builtin_unreachable (); <bb 5> [local count: 1073741824]: # i_5 = PHI <0(2), _1(3)> ``` Figuring out if we should reference _1 or _2 from i_5 is "hard", Sometimes GCC do the replacement but not always and I am not sure we know which one is correct always. In this case it is easy to use _2 is defined by i_5 but more complex examples are out there.