Message ID | 20101126163706.GP29412@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
On 11/26/2010 11:37 AM, Jakub Jelinek wrote: > + else if ((cgraph_function_possibly_inlined_p (decl) > + || DECL_DECLARED_INLINE_P (decl)) > > doesn't help though, it still ICEs. Without -feliminate-dwarf2-dups or > -gdwarf-4 it shows that abstract and concrete DIEs are separate, but > both are children of the same DW_TAG_structure_type "baz". Right, so the concrete instance needs to move to be under comp_unit_die. A comment in gen_subprogram_die says "We always want the DIE for this function that has the *_pc attributes to be under comp_unit_die so the debugger can find it." But it's not clear to me right now what code is trying to make that happen. Jason
On Sat, Nov 27, 2010 at 12:51:07AM -0500, Jason Merrill wrote: > On 11/26/2010 11:37 AM, Jakub Jelinek wrote: > >+ else if ((cgraph_function_possibly_inlined_p (decl) > >+ || DECL_DECLARED_INLINE_P (decl)) > > > >doesn't help though, it still ICEs. Without -feliminate-dwarf2-dups or > >-gdwarf-4 it shows that abstract and concrete DIEs are separate, but > >both are children of the same DW_TAG_structure_type "baz". > > Right, so the concrete instance needs to move to be under > comp_unit_die. A comment in gen_subprogram_die says "We always want > the DIE for this function that has the *_pc attributes to be under > comp_unit_die so the debugger can find it." But it's not clear to > me right now what code is trying to make that happen. It is dwarf2out_finish: for (node = limbo_die_list; node; node = next_node) { dw_die_ref die = node->die; next_node = node->next; if (die->die_parent == NULL) { dw_die_ref origin = get_AT_ref (die, DW_AT_abstract_origin); if (origin) add_child_die (origin->die_parent, die); ... which places the limbo nodes at origin's parent. BTW, the ICE happens with -O2 -gdwarf-4 -fkeep-inline-function mangle3.C or -O2 -feliminate-dwarf2-dups -fkeep-inline-functions mangle3.C as well. Jakub
--- dwarf2out.c.jj 2010-11-19 20:56:54.000000000 +0100 +++ dwarf2out.c 2010-11-26 17:26:25.000000000 +0100 @@ -20837,7 +20837,8 @@ gen_decl_die (tree decl, tree origin, dw /* If we're emitting an out-of-line copy of an inline function, emit info for the abstract instance and set up to refer to it. */ - else if (cgraph_function_possibly_inlined_p (decl) + else if ((cgraph_function_possibly_inlined_p (decl) + || DECL_DECLARED_INLINE_P (decl)) && ! DECL_ABSTRACT (decl) && ! class_or_namespace_scope_p (context_die) /* dwarf2out_abstract_function won't emit a die if this is