From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 665A63858D33; Tue, 14 Feb 2023 12:22:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 665A63858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676377337; bh=0k+nNR4Fluc4OUh1vctBH+E2mYVjjHBFHQ74sHZ8RK0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FHsT9PS2CTx7DIAxa5bTjcbcEvU24/RNpFYSAEbmPhAMgzgcCNBlWE88sf8oMpPDy QFoz5+sIavcJ+x+fhN6IqzBfEtK6rOf8Rzz6CYco1EpayogESXf0/JWK5QbLfaZokD iHiLJeG2pETM6DYHebV2CNYchXTQqRCvLCBbPVNg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/108772] [13 Regression] ICE in force_decl_die, at dwarf2out.cc:26751 since r13-4161-g32d16fe9d7e347bc Date: Tue, 14 Feb 2023 12:22:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code 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: 13.0 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=3D108772 --- Comment #5 from Richard Biener --- Btw, the limbo DIE is created via #0 new_die (tag_value=3DDW_TAG_variable, parent_die=3D,=20 t=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:5882 #1 0x0000000000e006ad in gen_variable_die ( decl=3D, origin=3D,=20 context_die=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:24574 #2 0x0000000000e08766 in gen_decl_die (decl=3D,=20 origin=3D, ctx=3D0x0, context_die=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:27108 #3 0x0000000000e09a73 in dwarf2out_decl (decl=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:27598 #4 0x0000000000e08dce in dwarf2out_late_global_decl ( decl=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:27286 #5 0x0000000001944222 in varpool_node::assemble_decl ( this=3D) at /home/rguenther/src/trunk/gcc/varpool.cc:603 #6 0x0000000001944a08 in symbol_table::output_variables (this=3D0x7ffff626= a000) at /home/rguenther/src/trunk/gcc/varpool.cc:764 when compiling without -flto we do not get any DIE for __tag. In the LTRANS unit the decl is unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff62803f0 precision:8 min max pointer_to_this > readonly constant addressable asm_written used public static QI t.ii:8:= 27 size unit-size align:8 warn_if_not_align:0 context initial (mem/u/c:QI (symbol_ref:DI ("_ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag= ") ) [0 __tag+0 S1 A8])> at compile time the symbol is _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag/0 (constexpr const char __tag) Type: variable definition analyzed=20 Visibility: semantic_interposition public weak comdat comdat_group:_ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag one_only References:=20 Referring: _ZNSt23_Sp_counted_ptr_inplace14_M_get_deleterERKi/9 (addr) Availability: not-ready Varpool flags: initialized read-only const-value-known at WPA time _ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag/0 (__tag) Type: variable definition analyzed Visibility: externally_visible semantic_interposition prevailing_def_ironly_exp public weak comdat comdat_group:_ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag one_only References:=20 Referring: _ZNSt23_Sp_counted_ptr_inplace14_M_get_deleterERKi/9 (addr) Read from file: a-t.o Availability: available Varpool flags: initialized read-only const-value-known When without -flto we reach varpool_node::assemble_decl we see unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7ffff6295690 precision:8 min max pointer_to_this > readonly constant addressable used public static tree_1 tree_2 tree_6 w= eak read decl_5 decl_6 decl_8 QI t.ii:8:27 size unit-size align:8 warn_if_not_align:0 context initial (mem/u/c:QI (symbol_ref/i:DI ("_ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__t= ag") ) [0 __tag+0 S1 A8])> but dwarf2out_late_global_decl just does nothing for this node since there was no DIE created early for it - we never call early_global_decl on it, instead we rely on the containing function, _S_ti, to eventually create a DIE for it, but even that doesn't get one. I suppose this is all a disconnect between how we handle -g1 with -flto, and for -g1 dwarf2out_late_global_decl should not fall into /* Fill-in any location information we were unable to determine on the first pass. */ if (VAR_P (decl)) { dw_die_ref die =3D lookup_decl_die (decl); /* We may have to generate full debug late for LTO in case debug was not enabled at compile-time or the target doesn't support the LTO early debug scheme. */ if (! die && in_lto_p) dwarf2out_decl (decl); another possibility would be to stream "no DIE" info for not late created decls or experiment with simply removing this path entirely?=