public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/114574] [14 regression] ICE when building curl with LTO (fld_incomplete_type_of, at ipa-free-lang-data.cc:257) since r14-9763
Date: Thu, 04 Apr 2024 06:46:55 +0000	[thread overview]
Message-ID: <bug-114574-4-oWWhtVhrZA@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114574-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |jsm28 at gcc dot gnu.org

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, build_qualified_type sets TYPE_CANONICAL of qualified types to either the
returned type or build_qualified_type of the TYPE_CANONICAL of the base type.
So, updating TYPE_CANONICAL of the variants to TYPE_CANONICAL of the base type
looks always wrong, it would need to recompute the TYPE_CANONICAL using
build_qualified_type instead.  But, similarly to build_qualified_type,
build_pointer_type, build_array_type etc. also similarly set TYPE_CANONICAL to
something based on the TYPE_CANONICAL.

So, if you really need to update TYPE_CANONICAL after type is completed, I'd at
least do it only if the new TYPE_CANONICAL is actually different from the base
type, otherwise don't update anything, and if you do update, one needs to also
recompute TYPE_CANONICAL on all the pointer types (those can be found through
for (t = TYPE_POINTER_TO (to_type); t; t = TYPE_NEXT_PTR_TO (t))),
but one would need to do that recursively to also update the **, ***, **** etc.
pointers), but also all created ARRAY_TYPEs (the shared ones can be found in
type_hash_table but non-shared can't), FUNCTION_TYPEs etc.

Which makes me wonder if for flag_isoc23 it wouldn't be better to
SET_TYPE_STRUCTURAL_EQUALITY on incomplete structure/union types and therefore
also on any POINTER_TYPE, ARRAY_TYPE, FUNCTION_TYPE, ... derived from that, and
only set
TYPE_CANONICAL when the aggregate is completed.  Yes, it will be slower to
compare
some of the types because one won't be able to use TYPE_CANONICAL, but given
the above it seems really hard to recompute TYPE_CANONICAL on everything that
could have been derived from TYPE_CANONICAL (type) = type of the incomplete
type when it will be later changed.

  parent reply	other threads:[~2024-04-04  6:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 12:42 [Bug lto/114574] New: [14 regression] ICE when building curl with LTO (internal compiler error: in fld_incomplete_type_of, at ipa-free-lang-data.cc:257) sjames at gcc dot gnu.org
2024-04-03 13:07 ` [Bug lto/114574] [14 regression] ICE when building curl with LTO (fld_incomplete_type_of, " sjames at gcc dot gnu.org
2024-04-03 13:30 ` sjames at gcc dot gnu.org
2024-04-03 14:15 ` [Bug lto/114574] [14 regression] ICE when building curl with LTO (fld_incomplete_type_of, at ipa-free-lang-data.cc:257) since r14-9763 jakub at gcc dot gnu.org
2024-04-03 15:51 ` jakub at gcc dot gnu.org
2024-04-03 15:57 ` jakub at gcc dot gnu.org
2024-04-03 18:02 ` uecker at gcc dot gnu.org
2024-04-04  5:29 ` uecker at gcc dot gnu.org
2024-04-04  6:14 ` uecker at gcc dot gnu.org
2024-04-04  6:46 ` jakub at gcc dot gnu.org [this message]
2024-04-04  7:07 ` uecker at gcc dot gnu.org
2024-04-04  7:18 ` rguenth at gcc dot gnu.org
2024-04-04  7:21 ` jakub at gcc dot gnu.org
2024-04-04  7:48 ` muecker at gwdg dot de
2024-04-04  7:57 ` muecker at gwdg dot de
2024-04-04 13:21 ` muecker at gwdg dot de
2024-04-05  5:16 ` muecker at gwdg dot de
2024-04-05  7:12 ` jakub at gcc dot gnu.org
2024-04-05  7:38 ` muecker at gwdg dot de
2024-04-05  7:45 ` jakub at gcc dot gnu.org
2024-04-05  7:51 ` muecker at gwdg dot de
2024-04-05  7:58 ` jakub at gcc dot gnu.org
2024-04-05  8:40 ` jakub at gcc dot gnu.org
2024-04-05 10:17 ` cvs-commit at gcc dot gnu.org
2024-04-06  5:46 ` xry111 at gcc dot gnu.org
2024-04-12 13:36 ` law at gcc dot gnu.org
2024-04-12 15:55 ` jakub at gcc dot gnu.org
2024-04-12 16:57 ` uecker at gcc dot gnu.org
2024-04-12 17:07 ` jakub at gcc dot gnu.org
2024-04-12 21:06 ` uecker at gcc dot gnu.org
2024-04-18 11:57 ` jakub at gcc dot gnu.org
2024-04-18 13:18 ` muecker at gwdg dot de
2024-04-19  8:20 ` jakub at gcc dot gnu.org
2024-04-19  8:30 ` jakub at gcc dot gnu.org
2024-04-19  8:35 ` pinskia at gcc dot gnu.org
2024-04-19 22:11 ` cvs-commit at gcc dot gnu.org
2024-04-19 22:25 ` jakub at gcc dot gnu.org

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-114574-4-oWWhtVhrZA@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).