From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C31E03858D1E; Sun, 9 Apr 2023 02:20:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C31E03858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681006833; bh=OG2wuy9viQ37pSOfRb988kAEL3rbvcFfprakDaSJb8w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XtdTiwuZT6zIxpt1sEpffQOTNrZm8yFuxxXDz6UMPuYtFIE68MohpVuvJG8yrTDEY bBFOlQ9d/K46DpS50ZcuvW+L4QOD+kIk3xjj8Y7iuj9lebWLysDbHW3SoBmpHuDJPe 74rfNgisJYI3tCSZkJ43IIgbHTv+Z94d2U3SaoSM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109450] Wrong code for VLA in struct sithe size expression Date: Sun, 09 Apr 2023 02:20:29 +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: unknown X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: keywords 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=3D109450 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code, | |wrong-code --- Comment #1 from Andrew Pinski --- The issue is related to struct foo in the function declaration. With a slightly modified code you can get an ICE instead: int bar(int n, struct foo *x) { int a =3D n; struct foo { char buf[a++]; }* p =3D x; return n =3D=3D a; } int main() { return bar(1, 0); }=