public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] middle-end/100786 - constant folding from incompatible alias
Date: Thu, 20 Jan 2022 15:21:49 +0100 (CET)	[thread overview]
Message-ID: <9p69r24-rs95-roq-7510-841399s88os@fhfr.qr> (raw)
In-Reply-To: <20220120140229.GP2646553@tucnak>

On Thu, 20 Jan 2022, Jakub Jelinek wrote:

> On Thu, Jan 20, 2022 at 02:58:21PM +0100, Richard Biener via Gcc-patches wrote:
> > The following avoids us ICEing doing constant folding from variables
> > with aliases of different types.  The formerly used fold_convert
> > wasn't entirely correct even for the cases it handled and using
> > a VIEW_CONVERT_EXPR avoids the ICE.  Reading from a larger alias
> > will cause unfolded constants to appear but appearantly we handle
> > that just "fine".
> > 
> >   b.0_1 = VIEW_CONVERT_EXPR<double>(1);
> 
> If they have the same sizes, why not, but doesn't int have
> different size from double and isn't VCE defined only for same sizes?

Well yes, it's undefined.  IL wise we only constrain us for SSA
operands, not constants.  But the whole testcase is undefined,
and previously we'd happily accept a int -1 as a -1 long by
sign-extending it.

I'm going to test an alternative patch tackling get_symbol_constant_value
which is only used from CCP (which looks suffering from the same issue)
and folding.

Richard.

  reply	other threads:[~2022-01-20 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 13:58 Richard Biener
2022-01-20 14:02 ` Jakub Jelinek
2022-01-20 14:21   ` Richard Biener [this message]
2022-01-20 15:10     ` Richard Biener
2022-03-26 16:54 FX
2022-03-28  6:34 ` Richard Biener

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=9p69r24-rs95-roq-7510-841399s88os@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).