From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B5F1E3858408; Fri, 19 Jan 2024 08:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5F1E3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705654262; bh=qhYrMwnRWpqVWxGmyRg8oOumMLGDX+FyXCVs7XJqkKk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZxG/ITZeb7TFNdblbNZLMGdV5smKnTc6yxG30EyZCTowgFlzpXjZcEa1PfYF/9Ict waitzdEAt9MRfVCFmHfIhn15dOnscOHk65VPEN6NsVFtdznw/QQxvbkJwdpDCCHPG2 4njrP4GQJtXlwV/AACdZ2oAeGfaKUxmtKJ6cmInY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/113488] [14 Regression] ICE in add_AT_die_ref with LTO since r14-5546 Date: Fri, 19 Jan 2024 08:50:52 +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: 14.0 X-Bugzilla-Keywords: lto 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: 14.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=3D113488 --- Comment #7 from Richard Biener --- OK, so it's of course set_decl_origin_self () invoked via #0 set_decl_origin_self (decl=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:23321 #1 0x00000000014ddc14 in set_block_origin_self (stmt=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:23290 #2 0x00000000014dde88 in set_decl_origin_self ( decl=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:23329 #3 0x00000000014de0c8 in dwarf2out_abstract_function ( decl=3D) at /home/rguenther/src/trunk/gcc/dwarf2out.cc:23379 #4 0x0000000001c0bce5 in tree_function_versioning ( old_decl=3D,=20 new_decl=3D, tree_map=3D0x0,=20 param_adjustments=3D0x4c3ad30, update_clones=3Dfalse,=20 blocks_to_copy=3D0x4be47a8, new_entry=3D) at /home/rguenther/src/trunk/gcc/tree-inline.cc:6222 #5 0x000000000144476f in cgraph_node::create_version_clone_with_body ( this=3D,=20 redirect_callers=3D..., tree_map=3D0x0, param_adjustments=3D0x4c3ad30,= =20 bbs_to_copy=3D0x4be47a8, new_entry_block=3D,=20 suffix=3D0x434dc0d "part", target_attributes=3D, version_decl= =3Dtrue) at /home/rguenther/src/trunk/gcc/cgraphclones.cc:1084 #6 0x000000000343c0d4 in split_function ( return_bb=3D,=20 split_point=3D0x4b13ba0 , add_tsan_func_exit=3Dfalse) at /home/rguenther/src/trunk/gcc/ipa-split.cc:1376 interesting enough we didn't generate a DIE for the LABEL_DECL for the abstract instance DIE. Instead we just have (gdb) p debug_dwarf_die (old_die) DIE 262: DW_TAG_subprogram (0x7ffff6867dc0) abbrev id: 4 offset: 262 mark: 0 DW_AT_name: "ReduceTrapIf" DW_AT_decl_file: "t.ii" (1) DW_AT_decl_line: 102 DW_AT_decl_column: 11 DW_AT_inline: 3 there. During early dwarf generation for this function we do not consider it possibly inlined, so /* If we're emitting a possibly inlined function emit it as abstract instance. */ else if (cgraph_function_possibly_inlined_p (decl) && ! DECL_ABSTRACT_P (decl) && ! class_or_namespace_scope_p (context_die) /* dwarf2out_abstract_function won't emit a die if this is j= ust a declaration. We must avoid setting DECL_ABSTRACT_ORIGI= N in that case, because that works only if we have a die. */ && DECL_INITIAL (decl) !=3D NULL_TREE) dwarf2out_abstract_function (decl); doesn't trigger and /* Otherwise we're emitting the primary DIE for this decl. */ else if (debug_info_level > DINFO_LEVEL_TERSE) neither. Instead we just generate the plain decl DIE. But we still do dwarf2out_abstract_function later for the clone origin. It's a bit complicated (-g1 wrecks quite some invariants), so I think I'm going to try fixup after the fact in LTO.=