From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7CE303855595; Fri, 12 May 2023 19:10:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CE303855595 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683918629; bh=SpA0koVgURopgqLFoUHj/diXKAPpouhE/i+VSP8yVYg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b9rZud8or1KyigM5D/wcVoknFckYllaITRvm0jKMt+qndUkbV99qNmQZZG81ZH4jY ordcIpIBpELs8JAceDJ4NSfUnwySKJ/3+Esf50M/WDpug4Rc82C7tPd9rGRJxZs/6v zahGeCvKng//tvMoWO+DT8gX8aacIxN+O289QkeE= From: "yann at droneaud dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109828] [13/14 Regression] C2x:static compound literal (with flexible array) in initializer leads to invalid size and ICE Date: Fri, 12 May 2023 19:10: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: 13.1.0 X-Bugzilla-Keywords: accepts-invalid, assemble-failure, ice-checking, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: yann at droneaud dot fr X-Bugzilla-Status: NEW 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=3D109828 --- Comment #4 from Yann Droneaud --- I'm still playing with this, for example https://godbolt.org/z/dfjr8veh5, a= nd I've noticed the size of the compound_initializer is incorrect too: struct s { char i; char c[]; }; const struct s *const s =3D &(static const struct s) { .c =3D "1", }; Compile too: .quad __compound_literal.4 .type __compound_literal.4, @object .size __compound_literal.4, 1 __compound_literal.4: .zero 1 .string "1" .zero 18446744073709551613 .zero 1 I would have have expected .size to be 3, not 1. Maybe it's the result of computing the size as 3 + -3 + 1, but it's far fetched.=