https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|`(a > 1) ? 0 : (a == 1)` is |`(a > 1) ? 0 : (a == 1)` is |not optimized when spelled |not optimized when spelled |out |out at -O2+ --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I should say this at -O2. part of the reason is VRP changes `a == 1` to be `(bool)a` and then phiopt comes along and decides to factor out the conversion (phiopt did that even before my recent changes). at -O1, it is actually optimized during reassoc1 (because the above is not done) since GCC 7.