From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF7CB3849ACE; Fri, 3 May 2024 08:25:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF7CB3849ACE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714724728; bh=GlJpewcA0WTFHt0hKXheL2nNVoo3hKO1V86Hr37/Pl0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P5fILaaWcWzCqu9oFIIMOpjnwi8uSW0+42HPRuAmEeJopAk5hR+CovMmhfqE1snsV Gm2bZLyUirvPZlnp4s65rR58VSufHpOA6InC2Gl1bmGsIBQbwV2sZyGVREsa+rsCms sx/5Qo4NfECHuu4lxv+8MxX4jZjqdccTUHb9SNco= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114931] [14/15 regression] ICE in get_alias_set when building tcl with -std=c23 Date: Fri, 03 May 2024 08:25:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114931 --- Comment #12 from Jakub Jelinek --- Anyway, such changes are a partial shift towards the model to update derived types which you said you don't want; it doesn't actually update them, but basically forces new types after the base type(s) is/are finalized. Another possibility might be simply in all the spots where we set TYPE_CANONICAL (t) =3D something; to add if (TYPE_STRUCTURAL_EQUALITY_P (TYPE_CANONICAL (t))) SET_TYPE_STRUCTURAL_EQUALITY (t); On the build_function_type it could be --- gcc/tree.cc.jj 2024-04-16 09:56:16.463008446 +0200 +++ gcc/tree.cc 2024-05-03 10:21:04.119086667 +0200 @@ -7511,17 +7511,25 @@ build_function_type (tree value_type, tr hashval_t hash =3D type_hash_canon_hash (t); t =3D type_hash_canon (hash, t); - /* Set up the canonical type. */ - any_structural_p =3D TYPE_STRUCTURAL_EQUALITY_P (value_type); - any_noncanonical_p =3D TYPE_CANONICAL (value_type) !=3D value_type; - canon_argtypes =3D maybe_canonicalize_argtypes (arg_types, - &any_structural_p, - &any_noncanonical_p); - if (any_structural_p) - SET_TYPE_STRUCTURAL_EQUALITY (t); - else if (any_noncanonical_p) - TYPE_CANONICAL (t) =3D build_function_type (TYPE_CANONICAL (value_type= ), - canon_argtypes); + if (TYPE_CANONICAL (t) =3D=3D t) + { + /* Set up the canonical type. */ + any_structural_p =3D TYPE_STRUCTURAL_EQUALITY_P (value_type); + any_noncanonical_p =3D TYPE_CANONICAL (value_type) !=3D value_type; + canon_argtypes =3D maybe_canonicalize_argtypes (arg_types, + &any_structural_p, + &any_noncanonical_p); + if (any_structural_p) + SET_TYPE_STRUCTURAL_EQUALITY (t); + else if (any_noncanonical_p) + { + TYPE_CANONICAL (t) + =3D build_function_type (TYPE_CANONICAL (value_type), + canon_argtypes); + if (TYPE_STRUCTURAL_EQUALITY_P (TYPE_CANONICAL (t))) + SET_TYPE_STRUCTURAL_EQUALITY (t); + } + } if (!COMPLETE_TYPE_P (t)) layout_type (t);=