public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS?
@ 2022-11-13 15:56 Aldy Hernandez
  2022-11-13 18:49 ` Aldy Hernandez
  0 siblings, 1 reply; 2+ messages in thread
From: Aldy Hernandez @ 2022-11-13 15:56 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc, amacleod

Based on discussions in the last few weeks, aren't most of the cases in 
tree_call_nonnegative_warnv_p() wrong when honoring NANS?

For example:
     CASE_CFN_ACOS:
     CASE_CFN_ACOS_FN:
     CASE_CFN_ACOSH:
     CASE_CFN_ACOSH_FN:
...
...
       /* Always true.  */
       return true;

But are we guaranteed a +NAN for any NAN input?  I thought we were only 
guaranteed the NAN sign for abs, copysign, assignment, etc?  Similarly 
for most other cases in this function.

Hmmm.  I really think a good chunk of fold-const.cc should live in 
range-ops.  It seems we're duplicating a lot of functionality. 
Similarly to bit-CCP as I've mentioned.

Aldy


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS?
  2022-11-13 15:56 are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS? Aldy Hernandez
@ 2022-11-13 18:49 ` Aldy Hernandez
  0 siblings, 0 replies; 2+ messages in thread
From: Aldy Hernandez @ 2022-11-13 18:49 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc, amacleod

I suppose most of the calls to tree_expr_nonnegative_p that apply to
floats in match.pd and tree-ssa-math-opts.cc are guarded by
!HONOR_NANS || tree_expr_nonnegative_p.  Still feels kinda delicate...

Aldy

On Sun, Nov 13, 2022 at 4:56 PM Aldy Hernandez <aldyh@redhat.com> wrote:
>
> Based on discussions in the last few weeks, aren't most of the cases in
> tree_call_nonnegative_warnv_p() wrong when honoring NANS?
>
> For example:
>      CASE_CFN_ACOS:
>      CASE_CFN_ACOS_FN:
>      CASE_CFN_ACOSH:
>      CASE_CFN_ACOSH_FN:
> ...
> ...
>        /* Always true.  */
>        return true;
>
> But are we guaranteed a +NAN for any NAN input?  I thought we were only
> guaranteed the NAN sign for abs, copysign, assignment, etc?  Similarly
> for most other cases in this function.
>
> Hmmm.  I really think a good chunk of fold-const.cc should live in
> range-ops.  It seems we're duplicating a lot of functionality.
> Similarly to bit-CCP as I've mentioned.
>
> Aldy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-13 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-13 15:56 are most floating point cases in tree_call_nonnegative_warnv_p() wrong for HONOR_NANS? Aldy Hernandez
2022-11-13 18:49 ` Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).