Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-09 Thread Joseph Myers
On Wed, 8 May 2024, Richard Biener wrote: > So it's reasonable to require -fnon-call-exceptions (which now enables > -fexceptions) and -fno-delete-dead-exceptions to have GCC preserve > a change of control flow side-effect of x*x? We do not preserve > FP exception bits set by otherwise unused

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-08 Thread Richard Biener
On Tue, May 7, 2024 at 10:44 PM Joseph Myers wrote: > > On Fri, 3 May 2024, Richard Biener wrote: > > > So what I do not necessarily agree with is that we need to preserve > > the multiplication with -fsignaling-nans. Do we consider a program doing > > > > handler() { exit(0); } > > > > x =

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-07 Thread Joseph Myers
On Fri, 3 May 2024, Richard Biener wrote: > So what I do not necessarily agree with is that we need to preserve > the multiplication with -fsignaling-nans. Do we consider a program doing > > handler() { exit(0); } > > x = sNaN; > ... > sigaction(SIGFPE, ... handler) > x*x; >

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-03 Thread Richard Biener
On Thu, May 2, 2024 at 3:48 PM Roger Sayle wrote: > > > > From: Richard Biener > > On Thu, May 2, 2024 at 11:34 AM Roger Sayle > > wrote: > > > > > > > > > > From: Richard Biener On Fri, Apr 26, > > > > 2024 at 10:19 AM Roger Sayle > > > > wrote: > > > > > > > > > > This patch addresses PR

RE: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Roger Sayle
> From: Richard Biener > On Thu, May 2, 2024 at 11:34 AM Roger Sayle > wrote: > > > > > > > From: Richard Biener On Fri, Apr 26, > > > 2024 at 10:19 AM Roger Sayle > > > wrote: > > > > > > > > This patch addresses PR middle-end/111701 where optimization of > > > > signbit(x*x) using

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Richard Biener
On Thu, May 2, 2024 at 11:34 AM Roger Sayle wrote: > > > > From: Richard Biener > > On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle > > wrote: > > > > > > This patch addresses PR middle-end/111701 where optimization of > > > signbit(x*x) using tree_nonnegative_p incorrectly eliminates a > > >

RE: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Roger Sayle
> From: Richard Biener > On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle > wrote: > > > > This patch addresses PR middle-end/111701 where optimization of > > signbit(x*x) using tree_nonnegative_p incorrectly eliminates a > > floating point multiplication when the operands may potentially be

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Richard Biener
On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle wrote: > > > This patch addresses PR middle-end/111701 where optimization of signbit(x*x) > using tree_nonnegative_p incorrectly eliminates a floating point > multiplication when the operands may potentially be signaling NaNs. > > The above bug fix