https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105903
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |tree-optimization Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Severity|normal |enhancement Last reconfirmed| |2022-06-08 Keywords| |missed-optimization --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Currently we have inside phiopt4 if (_5 < _6) goto <bb 4>; [50.00%] else goto <bb 3>; [50.00%] <bb 3> [local count: 536870913]: _9 = _5 > _6; <bb 4> [local count: 1073741824]: # prephitmp_10 = PHI <0(2), _9(3)> That is: (_5 < _6) ? 0 : (_5 > _6) Which I think can be optimized to just: (_5 > _6)