From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30D5D3858433; Tue, 28 Nov 2023 11:46:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30D5D3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701171993; bh=fAQfLk/nU9pSYj7pHs5Wt9wRRxTQAPlg+QpojM5aU9g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wSs92N7irjiaTQH6F10jiaRN62SI1aFFIYfiiRGAnxGd0ab4u+emuoo+Tagfde2oP Yr+76wa38ud1EA7kK5Si6tdyDigZJXH4X3OQFEhEzzT3aLQQxqJta0V/jiL3v2vOBE wbm3GrFJ0ck+ptXWa6yGYAIOLvGecJsWqK1p1f8M= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/112741] ICE: in gimplify_var_or_parm_decl, at gimplify.cc:3261 Date: Tue, 28 Nov 2023 11:46:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to everconfirmed 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=3D112741 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Ever confirmed|0 |1 Last reconfirmed| |2023-11-28 Status|UNCONFIRMED |ASSIGNED --- Comment #2 from Richard Biener --- Confirmed. The gimplifier asserts here: 3267 /* ??? If this is a local variable, and it has not been seen in a= ny 3268 outer BIND_EXPR, then it's probably the result of a duplicate 3269 declaration, for which we've already issued an error. It would 3270 be really nice if the front end wouldn't leak these at all. 3271 Currently the only known culprit is C++ destructors, as seen 3272 in g++.old-deja/g++.jason/binding.C. 3273 Another possible culpit are size expressions for variably modi= fied 3274 types which are lost in the FE or not gimplified correctly. */ 3275 if (VAR_P (decl) 3276 && !DECL_SEEN_IN_BIND_EXPR_P (decl) 3277 && !TREE_STATIC (decl) && !DECL_EXTERNAL (decl) 3278 && decl_function_context (decl) =3D=3D current_function_decl) 3279 { 3280 gcc_assert (seen_error ()); 3281 return GS_ERROR; 3282 } as we gimplify '((unsigned long) &c[0][j_2(D)][0] - (unsigned long) &c) + 4' during instrument_object_size. The GIMPLE frontend, when bypassing gimplification, doesn't set DECL_SEEN_IN_BIND_EXPR_P given there are no such things in GIMPLE. But it probably should set the flag anyway. Testing a patch.=