From: Richard Biener Date: Sun, 3 Feb 2019 10:53:01 +0000 (+0000) Subject: re PR debug/87295 ([early debug] ICE with -ffat-lto-objects -fdebug-types-section -g) X-Git-Tag: upstream/12.2.0~26405 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8eaf058ed6452f3648950b1fa68443bc8e5c106;p=platform%2Fupstream%2Fgcc.git re PR debug/87295 ([early debug] ICE with -ffat-lto-objects -fdebug-types-section -g) 2019-02-03 Richard Biener PR debug/87295 * dwarf2out.c (copy_ancestor_tree): Register non-stubs as orig. * g++.dg/debug/dwarf2/pr87295.C: New testcase. From-SVN: r268485 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33d4ecf..dc2116b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-02-03 Richard Biener + + PR debug/87295 + * dwarf2out.c (copy_ancestor_tree): Register non-stubs as + orig. + 2019-02-02 Jakub Jelinek PR middle-end/87887 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c2a5901..d78e75c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8169,6 +8169,11 @@ copy_ancestor_tree (dw_die_ref unit, dw_die_ref die, decl_table_entry **slot = NULL; struct decl_table_entry *entry = NULL; + /* If DIE refers to a stub unfold that so we get the appropriate + DIE registered as orig in decl_table. */ + if (dw_die_ref c = get_AT_ref (die, DW_AT_signature)) + die = c; + if (decl_table) { /* Check if the entry has already been copied to UNIT. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 904a591..30ac08b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-03 Richard Biener + + PR debug/87295 + * g++.dg/debug/dwarf2/pr87295.C: New testcase. + 2019-02-02 Thomas Koenig PR fortran/88298 diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr87295.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr87295.C new file mode 100644 index 0000000..3afe762 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr87295.C @@ -0,0 +1,22 @@ +// { dg-additional-options "-fdebug-types-section" } +// { dg-require-effective-target c++11 } + +struct A {}; +namespace N { + struct B { + using C = struct H {}; + using D = A; + }; +} +struct E : N::B { + typedef C C; +}; +namespace N { + struct F { + E::C d; + E::D h; + }; +} +struct G { + N::F i; +} j;