From 1eb231ed3ffab639276f638d0687f5299281117a Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 11 Jun 2015 13:33:40 -0400 Subject: [PATCH] dwarf2out.c (prune_unused_types): Handle unused top-level limbo dies. * dwarf2out.c (prune_unused_types): Handle unused top-level limbo dies. From-SVN: r224391 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 066d6691680..57900cebcc2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-11 Jason Merrill + + * dwarf2out.c (prune_unused_types): Handle unused top-level limbo + dies. + 2015-06-11 Marek Polacek * match.pd ((x & y) ^ (x | y)): Don't check for single_use. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8a36fe8db35..3a92b02560c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -23789,8 +23789,17 @@ prune_unused_types (void) if (skeleton_debug_str_hash) skeleton_debug_str_hash->empty (); prune_unused_types_prune (comp_unit_die ()); - for (node = limbo_die_list; node; node = node->next) - prune_unused_types_prune (node->die); + for (limbo_die_node **pnode = &limbo_die_list; *pnode; ) + { + node = *pnode; + if (!node->die->die_mark) + *pnode = node->next; + else + { + prune_unused_types_prune (node->die); + pnode = &node->next; + } + } for (ctnode = comdat_type_list; ctnode; ctnode = ctnode->next) prune_unused_types_prune (ctnode->root_die); -- 2.30.2