From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 86FF93858CDB; Thu, 4 Apr 2024 06:46:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 86FF93858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712213216; bh=760zT19xUt1+M6jvViqHizI1QRUJsQWRHLdHAMnSRLw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SA9xwwiC9lbB56cep3DQUEP8uNeScfatv4qiefchNuRSXlWse8iRte9XnZEWYZS/y R7GKUZvzLxGkM6F9+q3BXnIT0NRgBYh1M8yr3i5wkcVR8GCF+NiXYe34Yr4TE1FdpN j4JC0v+rxulNvgqRGFjtR3umGT2vjgDhvUSls654= From: "jakub at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D114574 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |jsm28 at gcc dot gnu.org --- Comment #9 from Jakub Jelinek --- 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 typ= e. So, updating TYPE_CANONICAL of the variants to TYPE_CANONICAL of the base t= ype 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 b= ase type, otherwise don't update anything, and if you do update, one needs to a= lso recompute TYPE_CANONICAL on all the pointer types (those can be found throu= gh for (t =3D TYPE_POINTER_TO (to_type); t; t =3D 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 theref= ore 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 th= at could have been derived from TYPE_CANONICAL (type) =3D type of the incomple= te type when it will be later changed.=