dwarf2out.c (prune_unused_types): Handle unused top-level limbo dies.
authorJason Merrill <jason@redhat.com>
Thu, 11 Jun 2015 17:33:40 +0000 (13:33 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 11 Jun 2015 17:33:40 +0000 (13:33 -0400)
* dwarf2out.c (prune_unused_types): Handle unused top-level limbo
dies.

From-SVN: r224391

gcc/ChangeLog
gcc/dwarf2out.c

index 066d66916803f67e72805ba1de36e875c9a0c157..57900cebcc2bbb13ce6e9ba3489893724ba10f74 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-11  Jason Merrill  <jason@redhat.com>
+
+       * dwarf2out.c (prune_unused_types): Handle unused top-level limbo
+       dies.
+
 2015-06-11  Marek Polacek  <polacek@redhat.com>
 
        * match.pd ((x & y) ^ (x | y)): Don't check for single_use.
index 8a36fe8db355b9f151415f7031a53e6af1248b54..3a92b02560cd86d5a4802f0dbb69f83475adf8d9 100644 (file)
@@ -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);