This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/85811] Invalid optimization with fmax, fabs and nan
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 May 2018 08:47:38 +0000
- Subject: [Bug middle-end/85811] Invalid optimization with fmax, fabs and nan
- Auto-submitted: auto-generated
- References: <bug-85811-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85811
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 17 May 2018, schwab@linux-m68k.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85811
>
> --- Comment #8 from Andreas Schwab <schwab@linux-m68k.org> ---
> > Is there sth like -NaN?!
>
> signbit can tell you.
True. I guess that also asks for the guarantee on the operand
for tree_single_nonnegative_warnv_p returning true. Does it
guarantee that OP >= 0 compares as true? Or merely !(OP < 0)?
So does it make sense for the function to return true for +NaN
or should we err on the side of caution and not do that?