From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F3B12384AB6D; Fri, 19 Apr 2024 08:20:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3B12384AB6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713514836; bh=jnSLAtkqSCnLY1wbFyolBT5i3iwJyp6D+/MvAg7BTvc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OelOkC8nhBBFs87qknj2USvgaKp6XrJNxpJUail/9a3J/H7iygD363zXvZCSNqZV3 m/JBw5kHtM/4CXIOIXy1TDArmg4Xeg0jzEIwBn5qcVvHUFY3j6BlrtSUkukwTEayH8 24I9hYSghioaKmRr/9mCaFdWNcP3mlT6zF0Amc2w= 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: Fri, 19 Apr 2024 08:20:24 +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: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned 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=3D114574 --- Comment #31 from Jakub Jelinek --- I've tried to construct a wrong-code testcase, but so far haven't been successful. In e.g. struct S { int s; } s; struct T { long l; } t; const struct S * foo (const struct S **p, const struct T **q) { *p =3D &s; *q =3D &t; return *p; } fre1 optimizes the return *p to return &s; So I've tried [[gnu::always_inline]] static inline const void * foo (void *x, bool y) { const struct S **p =3D (const struct S **) x; struct S { int s; }; static struct S s; if (y) *p =3D &s; return *p; } [[gnu::always_inline]] static inline void bar (void *x) { const struct S **q =3D (const struct S **) x; struct S { int s; }; static struct S s; *q =3D &s; } const void * baz (void *x, void *y) { foo (x, true); bar (y); return foo (x, false); } where without the posted patch I think the TYPE_CANONICAL on const struct S* should be wrong in the bar function, but strangely we don't optimize it.=