From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A7C04385B526; Mon, 27 Nov 2023 08:13:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7C04385B526 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701072797; bh=lNbsnMuKxopUQEA6bVumn8XbnNtNNQu54YVlsDpJn1I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aaA2QyYubHD6U+Q1Y2FKJiOTiYm4HlvdSRqF1tqtFDqLLJEbkAnCPRokjaqAMIDYT DvIZC6giGnBuMAmGkK/fFVjHeHt7dKjFsDSp3lJ+FaMTR9SZbzRpSxpELGxD8l0VyO jhQSOv7rivKCJ0Nkd+MT8pzcUbYaEOgLD04STkyA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/112716] LTO optimization with struct with variable size Date: Mon, 27 Nov 2023 08:13:17 +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: alias, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D112716 --- Comment #4 from Richard Biener --- Not that local types are never "merged" for cross-TU aliasing, they keep be= ing distinct types. In particular this applies to VLA types since the referenc= e to function-local vars ties them to the function IL sections and thus they do not become subject to global var/type unification. If it's undefined in C then the behavior is OK and expected. I don't think the C standard requirement can extend to VLA types this way.=