This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/81993] [7/8 Regression] -gsplit-dwarf removes some symbols, causing some undefined references
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Aug 2017 11:31:12 +0000
- Subject: [Bug debug/81993] [7/8 Regression] -gsplit-dwarf removes some symbols, causing some undefined references
- Auto-submitted: auto-generated
- References: <bug-81993-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81993
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we're creating a template value attribute at late finish time from
(gdb) p debug_generic_expr (e->arg)
{.__pfn=isClassMethod, .__delta=0}
as
(symbol_ref/i:DI ("_ZNK14ObjCMethodDecl13isClassMethodEv") [flags 0x3]
<function_decl 0x7ffff69ec200 isClassMethod>)
and register it with .debug_addr in new_addr_loc_descr.
resolve_addr should now prune that immediately again because the function
hasn't been output. _But_ the pending template value attribute was added
to a removed die (the type die).
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 251374)
+++ gcc/dwarf2out.c (working copy)
@@ -26037,7 +26037,8 @@ gen_remaining_tmpl_value_param_die_attri
j = 0;
FOR_EACH_VEC_ELT (*tmpl_value_parm_die_table, i, e)
{
- if (!tree_add_const_value_attribute (e->die, e->arg))
+ if (!e->die->removed
+ && !tree_add_const_value_attribute (e->die, e->arg))
{
dw_loc_descr_ref loc = NULL;
if (! early_dwarf
should avoid useless work and this issue.