diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-01-26 22:45:57 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-01-26 22:45:57 +0100 |
commit | b0670cc0eb260ce182c7eb2c0b25bcc0b59a0e68 (patch) | |
tree | 7847f74b9e981fab439502e6718fdac6e5b14fce /gcc | |
parent | f7c06c0f9955a6d12dd7eaef040de563fe279166 (diff) | |
download | gcc-b0670cc0eb260ce182c7eb2c0b25bcc0b59a0e68.zip gcc-b0670cc0eb260ce182c7eb2c0b25bcc0b59a0e68.tar.gz gcc-b0670cc0eb260ce182c7eb2c0b25bcc0b59a0e68.tar.bz2 |
re PR c++/79129 (ICE with -fdebug-types-section starting with r240578)
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.
* g++.dg/debug/dwarf2/pr79129.C: New test.
From-SVN: r244955
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/debug/dwarf2/pr79129.C | 12 |
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 553cf5e..2dc64c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f69c588..1b2c04c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -7918,6 +7918,19 @@ generate_skeleton_bottom_up (skeleton_chain_node *parent) 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 @@ -7936,6 +7949,7 @@ generate_skeleton_bottom_up (skeleton_chain_node *parent) 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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bec6f15..4d427fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-01-26 Jakub Jelinek <jakub@redhat.com> + PR debug/79129 + * g++.dg/debug/dwarf2/pr79129.C: New test. + PR debug/78835 * g++.dg/debug/dwarf2/pr78835.C: New test. diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr79129.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr79129.C new file mode 100644 index 0000000..a1ffd3d --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr79129.C @@ -0,0 +1,12 @@ +/* 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 () {} |