From: Richard Biener Date: Wed, 11 May 2016 13:59:34 +0000 (+0000) Subject: re PR debug/71057 (ICE in schedule_generic_params_dies_gen, at dwarf2out.c:24142) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dff70323a39a34ba26c729f50fe45d78912133e8;p=gcc.git re PR debug/71057 (ICE in schedule_generic_params_dies_gen, at dwarf2out.c:24142) 2016-05-11 Richard Biener PR debug/71057 * dwarf2out.c (retry_incomplete_types): Set early_dwarf. (dwarf2out_finish): Move retry_incomplete_types call ... (dwarf2out_early_finish): ... here. * g++.dg/debug/pr71057.C: New testcase. From-SVN: r236121 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ffef84e9844..23327327043 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-05-11 Richard Biener + + PR debug/71057 + * dwarf2out.c (retry_incomplete_types): Set early_dwarf. + (dwarf2out_finish): Move retry_incomplete_types call ... + (dwarf2out_early_finish): ... here. + 2016-05-11 Richard Biener PR middle-end/71002 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8f192e877d7..b0173f7a5ce 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -19405,11 +19405,13 @@ gen_entry_point_die (tree decl, dw_die_ref context_die) static void retry_incomplete_types (void) { + set_early_dwarf s; int i; for (i = vec_safe_length (incomplete_types) - 1; i >= 0; i--) if (should_emit_struct_debug ((*incomplete_types)[i], DINFO_USAGE_DIR_USE)) gen_type_die ((*incomplete_types)[i], comp_unit_die ()); + vec_safe_truncate (incomplete_types, 0); } /* Determine what tag to use for a record type. */ @@ -27390,10 +27392,6 @@ dwarf2out_finish (const char *filename) resolve_addr (comp_unit_die ()); move_marked_base_types (); - /* Walk through the list of incomplete types again, trying once more to - emit full debugging info for them. */ - retry_incomplete_types (); - if (flag_eliminate_unused_debug_types) prune_unused_types (); @@ -27694,6 +27692,10 @@ dwarf2out_finish (const char *filename) static void dwarf2out_early_finish (void) { + /* Walk through the list of incomplete types again, trying once more to + emit full debugging info for them. */ + retry_incomplete_types (); + /* The point here is to flush out the limbo list so that it is empty and we don't need to stream it for LTO. */ flush_limbo_die_list (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 019087254e0..4f7f0f86788 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-11 Richard Biener + + PR debug/71057 + * g++.dg/debug/pr71057.C: New testcase. + 2016-05-11 Jakub Jelinek PR fortran/70855 diff --git a/gcc/testsuite/g++.dg/debug/pr71057.C b/gcc/testsuite/g++.dg/debug/pr71057.C new file mode 100644 index 00000000000..2ed1eed988e --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr71057.C @@ -0,0 +1,12 @@ +// { dg-do compile } +// { dg-options "-g" } +template using decay_t = _Tp; +template struct A; +template struct B { B(A); }; +template struct C { + template using constructor = B>; + typedef constructor dummy; +}; +template struct D {}; +C a; +D> fn1() { fn1, a; }