diff mbox

Fix PR51650

Message ID alpine.LNX.2.00.1201021647080.4999@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Jan. 2, 2012, 3:49 p.m. UTC
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.

Comments

Jason Merrill Jan. 2, 2012, 7:42 p.m. UTC | #1
On 01/02/2012 10:49 AM, Richard Guenther wrote:
> 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?

Unconditional.  Anything that already passed the assert should be 
unaffected by the change.

> I can certainly give it a shot.  Just to check, do you mean the
> following?

Yes.

Jason
diff mbox

Patch

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);
            }
        }
     }