2017-01-26 Jakub Jelinek <jakub@redhat.com>
+ PR debug/79129
+ * dwarf2out.c (generate_skeleton_bottom_up): For children with
+ comdat_type_p set, just clone them, but keep the children in the
+ original DIE.
+
PR debug/78835
* dwarf2out.c (prune_unused_types): Mark all functions with DIEs
which have direct callers with -fvar-tracking-assignments enabled
add_child_die (parent->new_die, c);
c = prev;
}
+ else if (c->comdat_type_p)
+ {
+ /* This is the skeleton of earlier break_out_comdat_types
+ type. Clone the existing DIE, but keep the children
+ under the original (which is in the main CU). */
+ dw_die_ref clone = clone_die (c);
+
+ replace_child (c, clone, prev);
+ generate_skeleton_ancestor_tree (parent);
+ add_child_die (parent->new_die, c);
+ c = clone;
+ continue;
+ }
else
{
/* Clone the existing DIE, move the original to the skeleton
replace_child (c, clone, prev);
generate_skeleton_ancestor_tree (parent);
add_child_die (parent->new_die, c);
+ node.old_die = clone;
node.new_die = c;
c = clone;
}
--- /dev/null
+/* PR debug/79129 */
+/* { dg-do compile } */
+/* { dg-options "-gdwarf-4 -O2 -fdebug-types-section" } */
+
+struct B
+{
+ struct A { void foo (int &); };
+ A *bar ();
+ ~B () { int a = 1; bar ()->foo (a); }
+};
+struct C { ~C (); B c; };
+C::~C () {}