From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13344385770A; Tue, 23 May 2023 20:05:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13344385770A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684872322; bh=YswNxiFU95P7+tJ/DM0EiamJopb6rqnRRCiNWIsJRKw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jAJW6etag0W+5ZMEb4IfxGgTeUGTzXr59FKu2u6FAOfjNQFVhdDSluFgsxd4WsIs2 xhxsZPbke1HTHvueSCHbsx/v4uA6VaKhe9qEFkxfFM20JP7OjLqnP3eve2QijZ49r0 7/qBOzAlqRSTQRpBsthM7BxCIYAw87rHFXcbKRfI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109450] VLA struct definition vs use in the function declaration Date: Tue, 23 May 2023 20:05:21 +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: cvs-commit 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=3D109450 --- Comment #4 from CVS Commits --- The master branch has been updated by Martin Uecker : https://gcc.gnu.org/g:42d1612eb5c3b2ee327bc3336bfcbc43a0d0fc5b commit r14-1143-g42d1612eb5c3b2ee327bc3336bfcbc43a0d0fc5b Author: Martin Uecker Date: Sun May 21 19:32:01 2023 +0200 Fix ICEs related to VM types in C 2/2 [PR109450] Size expressions were sometimes lost and not gimplified correctly, leading to ICEs and incorrect evaluation order. Fix this by 1) not recursing pointers when gimplifying parameters, which was incorrect because it might access variables declared later for incomplete structs, and 2) adding a decl expr for variably-modified arrays that are pointed to by parameters declared as arrays. PR c/109450 gcc/ * function.cc (gimplify_parm_type): Remove function. (gimplify_parameters): Call gimplify_type_sizes. gcc/c/ * c-decl.cc (add_decl_expr): New function. (grokdeclarator): Add decl expr for size expression in types pointed to by parameters declared as arrays. gcc/testsuite/ * gcc.dg/pr109450-1.c: New test. * gcc.dg/pr109450-2.c: New test. * gcc.dg/vla-26.c: New test.=