From: Richard Biener <richard.guenther@gmail.com>
To: Eric Botcazou <botcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix artificial overflow during GENERIC folding
Date: Thu, 25 May 2023 08:22:34 +0200 [thread overview]
Message-ID: <CAFiYyc2ku1tCe9=eBBJzZ1oWhCtqnjsMMFCv2bd6gGWe4EL5Gg@mail.gmail.com> (raw)
In-Reply-To: <2560513.Lt9SDvczpP@fomalhaut>
On Wed, May 24, 2023 at 4:41 PM Eric Botcazou <botcazou@adacore.com> wrote:
>
> > But nobody is going to understand why the INTEGER_CST case goes the
> > other way.
>
> I can add a fat comment to that effect of course. :-)
>
> > As you say we don't have a good way to say we're doing
> > this to avoid undefined behavior, but then a view-convert back would
> > be a good way to indicate that? I can't come up with a better name
> > for a custom operator we could also use,
> >
> > (convert_without_overflow (negate (convert:utype @1))))
> >
> > maybe? As said, if view_convert works I prefer that. Does it?
>
> Well, VIEW_CONVERT_EXPR adds its own set of problems in GENERIC and it will
> precisely survive when it is not needed, so I'm not sure that's any better.
I guess there's no ideal way to achieve what we want here. Let's go with your
patch but with a comment before the INTEGER_CST check.
Thanks,
Richard.
> --
> Eric Botcazou
>
>
prev parent reply other threads:[~2023-05-25 6:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 9:54 Eric Botcazou
2023-05-24 11:15 ` Richard Biener
2023-05-24 12:39 ` Eric Botcazou
2023-05-24 13:09 ` Richard Biener
2023-05-24 14:41 ` Eric Botcazou
2023-05-25 6:22 ` 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='CAFiYyc2ku1tCe9=eBBJzZ1oWhCtqnjsMMFCv2bd6gGWe4EL5Gg@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=botcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/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).