https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117169
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-10-16 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. I think there's both code in reassoc and match.pd to handle this, eventually, if written if (x < 0) return 1; if (x & 3) return 1; also in gimple-fold.cc maybe_fold_or_comparisons (though nowadays match.pd is prefered). Usually x < 0 "combines" better so it's chosen as canonical form.