From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1008E3857400; Wed, 11 Jan 2023 21:20:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1008E3857400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673472018; bh=5etGI9+q22VQK+tB3uyHA9Iz50Yw/SfZJ0VFCGWHGb4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DFFo8jvJQM7uJu1EfsIq3lpcZz/TbmhFcj51f0vIPzMU6veKsvWduBTpYfur8zW7t SGfEzg0Jui45lmBl0upzdDia9fJ8Rt4wPUGAfLySL6bTDH8aYEt4Y6IrQWcby2zq5i RPUVghKfZxdjt4d0OUJr5btcMViHGF8N3cWWGjII= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105972] [12/13 Regression] ICE in lower_stmt, at gimple-low.cc:312 since r12-4608-gb4702276615ff8d4 Date: Wed, 11 Jan 2023 21:20:17 +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 #7 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:23b4ce18379cd336d99d7c71701be28118905b57 commit r13-5112-g23b4ce18379cd336d99d7c71701be28118905b57 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.=