On Sat, Aug 23, 2025 at 11:56 PM Matteo Nicoli
<matteo.nicoli...@gmail.com> wrote:
>
> Dear reviewers,
>
> I attached a patch for bug 121595 
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121595). I signed it, and added 
> `Reviewed-by: Andrew Pinski  <andrew.pin...@oss.qualcomm.com>` (here in CC).

+/* fabs(x + 0.0) -> fabs(x), safe even with signed zeros when
-fno-trapping-math.  */
+(for op (plus minus)
+ (simplify
+  (abs (op @0 real_zerop@1))
+  (if (!flag_trapping_math)
+   (abs @0))))

so forgive my ignorance, possibly IEEE abs() never raises FP exceptions
(unless operating on sNaN?)?  But does Inf + 0.0 raise FE_OVERFLOW?
Does NaN + 0.0 raise FE_INVALID?

So what I wonder is whether !HONOR_SNANS (@0) would be enough to check?

I refrained from trusting AI on those questions ...

Richard.

> Best regards,
> Matteo
>
>

Reply via email to