On Mon, 2 Jan 2012, Jason Merrill wrote: > It seems like using get_context_die instead of lookup_decl_die might do the > trick.
For the idea creating the DIE at the point we process the limbo DIE yes. But would you consider doing that unconditional or only for LTO? I can certainly give it a shot. Just to check, do you mean the following? Thanks, Richard. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 182784) +++ gcc/dwarf2out.c (working copy) @@ -22501,15 +22501,8 @@ dwarf2out_finish (const char *filename) else if (TYPE_P (node->created_for)) context = TYPE_CONTEXT (node->created_for); - gcc_assert (context - && (TREE_CODE (context) == FUNCTION_DECL - || TREE_CODE (context) == NAMESPACE_DECL)); - - origin = lookup_decl_die (context); - if (origin) - add_child_die (origin, die); - else - add_child_die (comp_unit_die (), die); + origin = get_context_die (context); + add_child_die (origin, die); } } }