https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108789
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|__builtin_(add|mul)_overflo |__builtin_(add|mul)_overflo
|w methods generate |w methods generate
|duplicate operations if |duplicate operations if
|both operands are const |both operands are const
| |which in turn causes wrong
| |code due to overlapping
| |arguments
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-11-09
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
The obvious workaround is to use a temporary variables for the arguments of
__builtin_add_overflow .