public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/113520] ICE with mismatched types with LTO (tree check: expected array_type, have integer_type in array_ref_low_bound)
Date: Thu, 25 Jan 2024 07:34:01 +0000	[thread overview]
Message-ID: <bug-113520-4-tqItv8wi6h@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113520-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113520

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #8)
> I think the ipa-cp summaries should be used only when types match. At least
> Martin added type streaming for all the jump functions.  So we are missing
> some check?

I don't think this applies here, we're having


foo (&b[5]);

with b being int vs int[], so it's not about the argument types matching
or the type of the JF but instead the value effectively changing during
streaming due to varpool node "merging".

As said elsewhere we avoid the issue by preserving the type of possibly
merged decls by wrapping it with a MEM_REF (for rvalues a V_C_E would
be possible as well).  And we unwrap it later when possible (but that's
of course optional).

I think any summary streaming referencing decls subject to WPA merging
need to do the same - it's not possible to recover after the fact since
the original type is lost (for the ARRAY_REF case it might be possible
to infer a type that would be good enough of course).

      parent reply	other threads:[~2024-01-25  7:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  6:18 [Bug tree-optimization/113520] New: ICE when building swi-prolog-9.1.2 " sjames at gcc dot gnu.org
2024-01-20  6:19 ` [Bug tree-optimization/113520] " sjames at gcc dot gnu.org
2024-01-20  6:21 ` pinskia at gcc dot gnu.org
2024-01-20  6:23 ` pinskia at gcc dot gnu.org
2024-01-20  6:35 ` sjames at gcc dot gnu.org
2024-01-20  6:36 ` pinskia at gcc dot gnu.org
2024-01-22  9:38 ` [Bug ipa/113520] ICE with mismatched types " rguenth at gcc dot gnu.org
2024-01-22  9:40 ` rguenth at gcc dot gnu.org
2024-01-24 15:51 ` hubicka at gcc dot gnu.org
2024-01-25  7:34 ` rguenth at gcc dot gnu.org [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=bug-113520-4-tqItv8wi6h@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).