From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 33E52385558E; Fri, 12 May 2023 18:41:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33E52385558E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683916915; bh=/gAqMDbGfHjR8cQHEkuNQl2JYyg5TSS3gJTLDFUz0Uo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TgqCsdeaTjEDsF4pAKt04wIcYH1fvaEeXN8EeivVqSmvIRjGn1O42l2UEeuYdjz8g Uav6h7BSpnE8t+QTPh7b2m0pn1XCcpf0A3aZE6tEvlkJwqqyVEOQGzkpjx6R8NUEOI 1eweAztAnIRr6SCSbn423udb2BXA5lTZcB0lfrI4= From: "pinskia at gcc dot gnu.org" 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 18:41:55 +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: pinskia at gcc dot gnu.org 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: everconfirmed short_desc cf_reconfirmed_on bug_status 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 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Summary|C2x:static compound literal |[13/14 Regression] |(with flexible array) in |C2x:static compound literal |initializer leads to |(with flexible array) in |invalid size and ICE |initializer leads to | |invalid size and ICE Last reconfirmed| |2023-05-12 Status|UNCONFIRMED |NEW --- Comment #3 from Andrew Pinski --- With: ``` struct s { int i; char c[]; }; const struct s *t =3D &(struct s) { .c =3D "2", }; ``` GCC 12 used to reject it: :3:44: error: non-static initialization of a flexible array member 3 | const struct s *t =3D &(struct s) { .c =3D "2", }; | ^~~ :3:44: note: (near initialization for '(anonymous)') Note I think the ICE would happen in GCC 13 with checking enabled too.=