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.