From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C44763858D38; Mon, 23 Jan 2023 19:44:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C44763858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674503053; bh=GltMKaCSFdBevKl0NMczyzDdHAyi41yaZS7ed6z7cnM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dbQ0zYN5Snyr1SzjTkNR6+tTzsGi6mu4hE7ljvzUTGIEHtNC72xHHRmdwmC60dYJ7 WxG7acGBt4VJweFuEZ9lPuEqyUxMEh++EhgnQXkU7WmD/7hT9xBfFNEmOyvtT9QJAt tdcER3/RGQ2g0PfmOQS4mBoOSK4o+MReTVJ7bWl4= From: "qinzhao at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107952] tree-object-size: inconsistent size for flexible arrays nested in structs Date: Mon, 23 Jan 2023 19:44:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: qinzhao at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: siddhesh 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=3D107952 --- Comment #7 from qinzhao at gcc dot gnu.org --- (In reply to Richard Biener from comment #1) > GCC considered this as a flex-array.=20 do you mean for the following example: typedef struct { char pad; char data[]; } F2; typedef struct { unsigned pad; F2 flex; } S2; although C standard disallow the above, GCC extension treats S2.flex.data a= s a flex-array?=20 How about: typedef struct { char pad; char data[]; } F2; typedef struct { F2 flex; unsigned pad; } S2; do we have any documentation on this Gcc extension?=