From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 389C13898519; Fri, 10 Feb 2023 17:45:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 389C13898519 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676051140; bh=hEbT6F/CS1Z+cRbYdGa8Yitl46fyBQMCpFNlrlT9J54=; h=From:To:Subject:Date:In-Reply-To:References:From; b=veL4G4JV5t7l+rIgTR2dAVTsYZ/OiJtv62z1U66Yriz4ibVbRliPGy1BTkaDQTk5g rTyu7Oern2riTcv+DKKtgb7iYksFZsDLvSrdgofMFFqoRhL7Yp8dtOV189ulG3ptft sY15dIRi8OGFDDpNsI+qyUO4OHQ31HkHQFGsSL2Y= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105972] [12 Regression] ICE in lower_stmt, at gimple-low.cc:312 since r12-4608-gb4702276615ff8d4 Date: Fri, 10 Feb 2023 17:45:39 +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.0 X-Bugzilla-Keywords: error-recovery, ice-checking, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D105972 --- Comment #8 from CVS Commits --- The releases/gcc-12 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c2b33b330c16a97627e987c60a6ca35ed0fdea56 commit r12-9140-gc2b33b330c16a97627e987c60a6ca35ed0fdea56 Author: Jakub Jelinek Date: Wed Jan 11 22:18:42 2023 +0100 c: Don't emit DEBUG_BEGIN_STMTs for K&R function argument declarations [PR105972] K&R function parameter declarations are handled by calling recursively c_parser_declaration_or_fndef in a loop, where each such call will add_debug_begin_stmt at the start. Now, if the K&R function definition is not a nested function, building_stmt_list_p () is false and so we don't emit the DEBUG_BEGIN_S= TMTs anywhere, but if it is a nested function, we emit it in the containing function at the point of the nested function definition. As the following testcase shows, it can cause ICEs if the containing function has var-tracking disabled but nested function has them enabled, as the DEBUG_BEGIN_STMTs are added to the containing function which shouldn't have them but MAY_HAVE_DEBUG_MARKER_STMTS is checked already for the nested function, or just wrong experience in the debugger. The following patch ensures we don't emit any such DEBUG_BEGIN_STMTs for the K&R function parameter declarations even in nested functions. 2023-01-11 Jakub Jelinek PR c/105972 * c-parser.cc (c_parser_declaration_or_fndef): Disable debug non-bind markers for K&R function parameter declarations of nested functions. * gcc.dg/pr105972.c: New test. (cherry picked from commit 23b4ce18379cd336d99d7c71701be28118905b57)=