summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-16 08:47:24 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-16 08:47:24 +0000
commit830de8802605291b6efb98b1a8fa3f8cd17b979f (patch)
treef80241d2381632dfc058bee12ceb23fe8b4a85ce /gcc/dwarf2out.c
parentdd76b89f2d2aff3094d92c34261afa705be08e30 (diff)
downloadgcc-830de8802605291b6efb98b1a8fa3f8cd17b979f.tar.gz
PR debug/52260
* dwarf2out.c (copy_decls_walk): Fill in *slot before traversing children with clone_tree_hash, not after it. * g++.dg/debug/dwarf2/pr52260.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184303 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index d6fbce6771c..5c7d8aabadc 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -7471,14 +7471,6 @@ copy_decls_walk (dw_die_ref unit, dw_die_ref die, htab_t decl_table)
dw_die_ref parent = unit;
dw_die_ref copy = clone_die (targ);
- FOR_EACH_CHILD (targ, c,
- add_child_die (copy,
- clone_tree_hash (c, decl_table)));
-
- /* Make sure the cloned tree is marked as part of the
- type unit. */
- mark_dies (copy);
-
/* Record in DECL_TABLE that TARG has been copied.
Need to do this now, before the recursive call,
because DECL_TABLE may be expanded and SLOT
@@ -7488,6 +7480,14 @@ copy_decls_walk (dw_die_ref unit, dw_die_ref die, htab_t decl_table)
entry->copy = copy;
*slot = entry;
+ FOR_EACH_CHILD (targ, c,
+ add_child_die (copy,
+ clone_tree_hash (c, decl_table)));
+
+ /* Make sure the cloned tree is marked as part of the
+ type unit. */
+ mark_dies (copy);
+
/* If TARG has surrounding context, copy its ancestor tree
into the new type unit. */
if (targ->die_parent != NULL