Patchwork Fix PR51650

login
register
mail settings
Submitter Richard Guenther
Date Jan. 2, 2012, 3:49 p.m.
Message ID <alpine.LNX.2.00.1201021647080.4999@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/133864/
State New
Headers show

Comments

Richard Guenther - Jan. 2, 2012, 3:49 p.m.
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.
Jason Merrill - Jan. 2, 2012, 7:42 p.m.
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

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