From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB3173858297; Tue, 23 Jan 2024 08:52:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB3173858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705999936; bh=BlgATsi/UajQNfVeJU1/nO50DWajh7EsgDscHrEveOQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mvMWM2I0y3lMjZ6Gg5JnWAaQpzZvKm/NA3pYkKwurGmsABycUZ/sb/KNf1AzZcTOZ 0KZq8byW6wefwg3kGlVZMbIFta/gUyhg6ltsl2d9RD7ngNx2KQnjUc0ycwtjdPejPH 0owBfw3I7dyQsWLE514KtOE6ktXkgOzCUw3r0zuo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107058] [11/12/13/14 Regression] ICE in dwarf2out_die_ref_for_decl, at dwarf2out.cc:6038 since r11-5003-gd50310408f54e380 Date: Tue, 23 Jan 2024 08:52:01 +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: ice-on-valid-code, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component 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=3D107058 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|debug |c++ --- Comment #5 from Richard Biener --- The particular reason we even stream the CONST_DECL is that it appears in int __attribute__((aligned (A))) foo; via the attribute list: unit-size align:32 warn_if_not_align:0 symtab:-157035984 alias-set 2 canonical-type 0x7ffff6a305e8 precision:32 min max pointer_to_this > addressable public static SI pr50459.c:13:34 size unit-size user align:1024 warn_if_not_align:0 context attributes value = >> chain > where we "failed" to replace the CONST_DECL with its value. When handling the attribute we're doing align_expr =3D TREE_VALUE (args); if (align_expr && TREE_CODE (align_expr) !=3D IDENTIFIER_NODE && TREE_CODE (align_expr) !=3D FUNCTION_DECL) align_expr =3D default_conversion (align_expr); and that resolves it to an INTEGER_CST for further processing. I'll note that streaming out debug references from certain contexts like attribute arguments is also unnecessary but it's difficult to selectively disable it. IMO the correct thing to do is for the C++ frontend to, like the C frontend, resolve the enumerators before calling common_handle_aligned_attribute. It's also possible to more gracefully handle the assert it's still a bug. I'm going to handle it gracefully when not checking.=