[Bug middle-end/122004] x86 optimization: (x > INT_MAX - c) can utilize overflow flag to save code size
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 19 16:55:06 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122004
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2025-09-19
Ever confirmed|0 |1
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
There is code in canonicalize_comparison which compares the cost of +1/-1 of
the constant. I wonder if there is a way to add to compare the cost of
expansion of __builtin_sub_overflow_p there.
More information about the Gcc-bugs
mailing list