From: Richard Biener <richard.guenther@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Aldy Hernandez <aldyh@redhat.com>,
Joseph Myers <joseph@codesourcery.com>,
GCC patches <gcc-patches@gcc.gnu.org>,
Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [PATCH] [range-ops] Implement sqrt.
Date: Fri, 18 Nov 2022 13:14:19 +0100 [thread overview]
Message-ID: <81052E72-77B1-4381-A9A2-081F55DCEA5A@gmail.com> (raw)
In-Reply-To: <Y3diHvaBXQHP/9Nh@tucnak>
> Am 18.11.2022 um 11:44 schrieb Jakub Jelinek <jakub@redhat.com>:
>
> On Fri, Nov 18, 2022 at 11:37:42AM +0100, Aldy Hernandez wrote:
>>> Practically strictly
>>> preserving IEEE exceptions is only important for a very small audience, and
>>> for that even INEXACT will matter (but we still have -ftrapping-math
>>> by default).
>>> For that audience likely all constant / range propagation is futile and thus the
>>> easiest thing might be to simply cut that off completely?
>>>
>>> I'd say what ranger does is reasonable with -ftrapping-math given the current
>>> practice of handling this option. There's no point in trying to preserve the
>>> (by accident) "better" handling without ranger. Instead as Joseph says somebody
>>> would need to sit down, split -ftrapping-math, adjust the default and thorougly
>>> document things (also with -fnon-call-exceptions which magically makes
>>> IEEE flag raising operations possibly throw exceptions). As there's currently
>>> no code motion barriers for FP code with respect to exception flag inspection
>>> any dead code we preserve is likely going to be unhelpful.
>>>
>>> So for now simply amend the documentation as to what -ftrapping-math
>>> currently means with respect to range/constant propagation?
>>
>> So something like "Even in the presence of -ftrapping-math, VRP may fold
>> operations that may cause exceptions For example, an addition that is
>> guaranteed to produce a NAN, may be replaced with a NAN, thus eliding the
>> addition. This may cause any exception that may have been generated by the
>> addition to not appear in the final program."
>>
>> ??
>
> If we just adjust user expectations for -ftrapping-math, shouldn't we
> introduce another option that will make sure we never optimize away floating
> point operations which can trap (and probably just disable frange for that
> mode)?
I think it’s just like -frounding-math and Fenv access - the intent is there but the implementation is known buggy (and disabling optimizations doesn’t fully fix it).
Richard
> Jakub
>
prev parent reply other threads:[~2022-11-18 12:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-13 20:05 Aldy Hernandez
2022-11-13 20:39 ` Jakub Jelinek
2022-11-14 7:45 ` Aldy Hernandez
2022-11-14 14:30 ` Jeff Law
2022-11-14 14:35 ` Jakub Jelinek
2022-11-14 14:48 ` Jeff Law
2022-11-14 15:01 ` Aldy Hernandez
2022-11-14 21:55 ` Joseph Myers
2022-11-16 20:32 ` Jakub Jelinek
2022-11-17 16:40 ` Aldy Hernandez
2022-11-17 16:48 ` Aldy Hernandez
2022-11-17 17:42 ` Aldy Hernandez
2022-11-17 18:59 ` Joseph Myers
2022-11-17 19:37 ` Jakub Jelinek
2022-11-17 20:43 ` Joseph Myers
2022-11-18 8:39 ` Richard Biener
2022-11-18 10:37 ` Aldy Hernandez
2022-11-18 10:44 ` Jakub Jelinek
2022-11-18 11:20 ` Aldy Hernandez
2022-11-18 11:57 ` Aldy Hernandez
2022-11-18 12:14 ` Richard Biener [this message]
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=81052E72-77B1-4381-A9A2-081F55DCEA5A@gmail.com \
--to=richard.guenther@gmail.com \
--cc=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@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).