https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112857
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Last reconfirmed| |2023-12-05 Ever confirmed|0 |1 CC| |pinskia at gcc dot gnu.org Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. I was actually going to file this one but my access to gcc.gnu.org was not working all day. Note all of the following testcases should produce the same code too: ``` int g0(int a, int b) { return b > a; } int g10(int a, int b) { return (b-a) > 0; } int g(int a, int b) { return (b + ~ a) >= 0; } int g1(int a, int b) { return (b - a) -1 >= 0; } int g2(int a, int b) { return (b + (-a-1)) >= 0; } int g3(int a, int b) { return (b + ~ a) + 1 > 0; } int g4(int a, int b) { return (b + (~ a + 1)) > 0; } ``` For the above, GCC is able to get the best code for g0, g10, g1, and g4 (though g1 and g4 are still `(b-a) > 0` at the gimple level. While LLVM is able to get it for g0, g10 and g4 (g3 is close though with `(b-a) > 0`).