https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113411

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-16
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think it's OK for reals with -fno-rounding-math.

It's valid for integers with or without undefined overflow, the corner
case to consider is

  abs(-INT_MAX - 1) * abs (b)

where with undefined overflow the abs() is already invoking undefined
behavior.  The problematical multiplication is (-INT_MAX-1) * -1 but
we cannot arrive at this from a defined input.  For

  abs(a*b)

the problematical input is -INT_MAX - 1 but we can't arrive at that
either (b == 1 with a == -INT_MAX-1 is undefined, b == -1 the same).

Reply via email to