From: Richard Sandiford <richard.sandiford@arm.com>
To: Richard Biener <rguenther@suse.de>
Cc: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] tree-optimization/110243 - kill off IVOPTs split_offset
Date: Wed, 21 Jun 2023 12:13:30 +0100 [thread overview]
Message-ID: <mptjzvx83vp.fsf@arm.com> (raw)
In-Reply-To: <nycvar.YFH.7.77.849.2306210933470.4723@jbgna.fhfr.qr> (Richard Biener's message of "Wed, 21 Jun 2023 10:36:48 +0000 (UTC)")
Richard Biener <rguenther@suse.de> writes:
> The issue in the PR the change is fixing is that we end up with
> an expression that overflows but uses signed arithmetic and so
> we miscompile it later. IIRC the fixes to split_constant_offset
> always were that the sum of the base + offset wasn't equal to
> the original expression, right?
Yeah, that's right. (sizetype)(INT_MIN - foo) was split into
(sizetype)INT_MIN + (sizetype)(-foo), and so we ended up with
((sizetype)INT_MIN)*2 rather than 0 for foo==INT_MIN.
Unfortunately, it looks like a lot of the discussion happened on
irc (my fault) and I didn't keep logs.
Thanks,
Richard
prev parent reply other threads:[~2023-06-21 11:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 12:34 Richard Biener
2023-06-19 18:32 ` Jeff Law
2023-06-19 20:34 ` Richard Sandiford
2023-06-20 7:36 ` Richard Biener
2023-06-20 20:48 ` Richard Sandiford
2023-06-21 9:14 ` Richard Biener
2023-06-21 10:36 ` Richard Biener
2023-06-21 11:13 ` Richard Sandiford [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=mptjzvx83vp.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=rguenther@suse.de \
/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).