From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D75273858C31; Wed, 31 Jan 2024 21:40:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D75273858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706737224; bh=bJqST3YccQqB+620sMEUu+FKLQEiwOcBhYzGs1jdisw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n8C9L0V4FMNrlnICDVc1dVqnKZjjciV0fTrmUP6Ejhl/yZvgDYKexQMMTnMQ04/uU GuR3FrjuvGC+7ptLS3jljBaBz+a6zfjRvzdl8w1ND+ZDFgSpzfh+VwGfJOZ5W8xfeY wOn3wXtDkQFW2x19Ie3KMmg/VX5eWot8AqBhIRqM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/112571] [13/14 Regression] ICE with nested redefinition of enum Date: Wed, 31 Jan 2024 21:40:23 +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: 14.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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=3D112571 --- Comment #3 from GCC Commits --- The master branch has been updated by Joseph Myers : https://gcc.gnu.org/g:d22d1a9346f27db41459738c6eb404f8f0956e6f commit r14-8669-gd22d1a9346f27db41459738c6eb404f8f0956e6f Author: Joseph Myers Date: Wed Jan 31 21:39:53 2024 +0000 c: Fix ICE for nested enum redefinitions with/without fixed underlying = type [PR112571] Bug 112571 reports an ICE-on-invalid for cases where an enum is defined, without a fixed underlying type, inside the enum type specifier for a definition of that same enum with a fixed underlying type. The ultimate cause is attempting to access ENUM_UNDERLYING_TYPE in a case where it is NULL. Avoid this by clearing ENUM_FIXED_UNDERLYING_TYPE_P in thie case of inconsistent definitions. Bootstrapped wth no regressions for x86_64-pc-linux-gnu. PR c/112571 gcc/c/ * c-decl.cc (start_enum): Clear ENUM_FIXED_UNDERLYING_TYPE_P wh= en defining without a fixed underlying type an enumeration previou= sly declared with a fixed underlying type. gcc/testsuite/ * gcc.dg/c23-enum-9.c, gcc.dg/c23-enum-10.c: New tests.=