aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-06-21 13:56:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-06-21 13:56:54 +0000
commit050e182a757bdf227a7e2425f06f9e2fd4dff8cb (patch)
tree066a78d41879709dcfd6acba5464f79e1bc6cb7e /gcc/dwarf2out.c
parentb614fca25fac28542b8c6b2df3862688b96e0581 (diff)
downloadgcc-050e182a757bdf227a7e2425f06f9e2fd4dff8cb.zip
gcc-050e182a757bdf227a7e2425f06f9e2fd4dff8cb.tar.gz
gcc-050e182a757bdf227a7e2425f06f9e2fd4dff8cb.tar.bz2
re PR debug/90914 (ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153)
2019-06-21 Richard Biener <rguenther@suse.de> PR debug/90914 * dwarf2out.c (prune_unused_types_walk): Always consider function-local extern declarations as used. * g++.dg/debug/pr90914.C: New testcase. From-SVN: r272547
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 960d9be..6a85c12 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -29419,9 +29419,16 @@ prune_unused_types_walk (dw_die_ref die)
break;
/* premark_used_variables marks external variables --- don't mark
- them here. */
+ them here. But function-local externals are always considered
+ used. */
if (get_AT (die, DW_AT_external))
- return;
+ {
+ for (c = die->die_parent; c; c = c->die_parent)
+ if (c->die_tag == DW_TAG_subprogram)
+ break;
+ if (!c)
+ return;
+ }
}
/* FALLTHROUGH */