dwarf2out.c (reference_to_unused, [...]): Avoid creating of new varool nodes.
authorJan Hubicka <jh@suse.cz>
Sun, 30 May 2010 12:27:18 +0000 (14:27 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 30 May 2010 12:27:18 +0000 (12:27 +0000)
* dwarf2out.c (reference_to_unused,
premark_types_used_by_global_vars_helper): Avoid creating of new
varool nodes.

From-SVN: r160052

gcc/ChangeLog
gcc/dwarf2out.c

index b31797b19b1dc38ba3fc505781ee91fb4d33a63a..12fe9f980c8928f475f143d6a17b08f5a9aad2f0 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-30  Jan Hubicka  <jh@suse.cz>
+
+       * dwarf2out.c (reference_to_unused,
+       premark_types_used_by_global_vars_helper): Avoid creating of new
+       varool nodes.
+
 2010-05-30  Jan Hubicka  <jh@suse.cz>
 
        * cgraph.h (cgraph_node_cannot_return,
index eec92d342e6e32ab8957eb9258e2f941ff66c8c8..48f5fa4c2085a38ca6ff962878eb365a9176fac2 100644 (file)
@@ -15938,8 +15938,8 @@ reference_to_unused (tree * tp, int * walk_subtrees,
     return *tp;
   else if (TREE_CODE (*tp) == VAR_DECL)
     {
-      struct varpool_node *node = varpool_node (*tp);
-      if (!node->needed)
+      struct varpool_node *node = varpool_get_node (*tp);
+      if (!node || !node->needed)
        return *tp;
     }
   else if (TREE_CODE (*tp) == FUNCTION_DECL
@@ -18213,8 +18213,8 @@ premark_types_used_by_global_vars_helper (void **slot,
     {
       /* Ask cgraph if the global variable really is to be emitted.
          If yes, then we'll keep the DIE of ENTRY->TYPE.  */
-      struct varpool_node *node = varpool_node (entry->var_decl);
-      if (node->needed)
+      struct varpool_node *node = varpool_get_node (entry->var_decl);
+      if (node && node->needed)
        {
          die->die_perennial_p = 1;
          /* Keep the parent DIEs as well.  */