From: Marc Glisse <marc.glisse@inria.fr>
To: Joseph Myers <joseph@codesourcery.com>
Cc: FX <fxcoudert@gmail.com>, Jakub Jelinek <jakub@redhat.com>,
gcc@gcc.gnu.org, FX via Fortran <fortran@gcc.gnu.org>
Subject: Re: Floating-point comparisons in the middle-end
Date: Thu, 1 Sep 2022 17:57:21 +0200 (CEST) [thread overview]
Message-ID: <e6060be6-2521-d581-309e-85aab3d79748@inria.fr> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2209011520170.550568@digraph.polyomino.org.uk>
On Thu, 1 Sep 2022, Joseph Myers wrote:
> On Thu, 1 Sep 2022, FX via Gcc wrote:
>
>> A tentative patch is attached, it seems to work well on simple examples,
>> but for test coverage the hard part is going to be that the comparisons
>> seem to be optimised away very easily into their non-signaling versions.
>> Basically, if I do:
>
> Presumably that can be reproduced without depending on the new built-in
> function? In which case it's an existing bug somewhere in the optimizers.
(simplify
(cmp @0 REAL_CST@1)
[...]
(if (REAL_VALUE_ISNAN (TREE_REAL_CST (@1))
&& !tree_expr_signaling_nan_p (@1)
&& !tree_expr_maybe_signaling_nan_p (@0))
{ constant_boolean_node (cmp == NE_EXPR, type); })
only tries to preserve a comparison with sNaN, but not with qNaN. There
are probably other issues since various gcc devs used to have a different
opinion on the meaning of -ftrapping-math.
--
Marc Glisse
next prev parent reply other threads:[~2022-09-01 15:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 8:04 FX
2022-09-01 8:19 ` Jakub Jelinek
2022-09-01 9:04 ` FX
2022-09-01 9:23 ` Jakub Jelinek
2022-09-01 10:06 ` FX
2022-09-01 15:21 ` Joseph Myers
2022-09-01 15:57 ` Marc Glisse [this message]
2022-09-01 16:22 ` Joseph Myers
2022-09-01 16:24 ` FX
2022-09-01 16:44 ` Joseph Myers
2022-09-01 18:15 ` FX
2022-09-01 14:32 ` Segher Boessenkool
2022-09-01 15:19 ` Joseph Myers
2022-09-01 18:38 ` FX
2022-09-01 19:13 ` Joseph Myers
2022-09-01 18:47 ` FX
2022-09-01 19:16 ` Joseph Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e6060be6-2521-d581-309e-85aab3d79748@inria.fr \
--to=marc.glisse@inria.fr \
--cc=fortran@gcc.gnu.org \
--cc=fxcoudert@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=joseph@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).