OSDN Git Service

PR bootstrap/41620
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 10:06:52 +0000 (10:06 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 10:06:52 +0000 (10:06 +0000)
* ipa.c (cgraph_externally_visible_p,
function_and_variable_visibility,
whole_program_function_and_variable_visibility): Skip non-finalized
nodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152556 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa.c

index 70b2861..a26d6dd 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-08  Jan Hubicka  <jh@suse.cz>
+
+       PR bootstrap/41620
+       * ipa.c (cgraph_externally_visible_p,
+       function_and_variable_visibility,
+       whole_program_function_and_variable_visibility): Skip non-finalized
+       nodes.
+
 2009-10-08  Nick Clifton  <nickc@redhat.com>
 
        * config/mn10300/mn10300.h (CONSTANT_ADDRESS_P): Do not allow
index 50eade0..c859242 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -254,6 +254,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
 static bool
 cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program)
 {
+  if (!node->local.finalized)
+    return false;
   if (!DECL_COMDAT (node->decl)
       && (!TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl)))
     return false;
@@ -312,6 +314,8 @@ function_and_variable_visibility (bool whole_program)
     }
   for (vnode = varpool_nodes_queue; vnode; vnode = vnode->next_needed)
     {
+      if (!vnode->finalized)
+        continue;
       if (vnode->needed
          && (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl))
          && (!whole_program
@@ -392,7 +396,7 @@ whole_program_function_and_variable_visibility (void)
   function_and_variable_visibility (flag_whole_program);
 
   for (node = cgraph_nodes; node; node = node->next)
-    if (node->local.externally_visible)
+    if (node->local.externally_visible && node->local.finalized)
       cgraph_mark_needed_node (node);
   for (vnode = varpool_nodes_queue; vnode; vnode = vnode->next_needed)
     if (vnode->externally_visible)