cgraph.c (cgraph_mark_reachable_node): Accept references to optimized out extern...
authorJan Hubicka <jh@suse.cz>
Tue, 11 May 2010 08:19:28 +0000 (10:19 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 11 May 2010 08:19:28 +0000 (08:19 +0000)
* cgraph.c (cgraph_mark_reachable_node): Accept references to optimized
out extern inlines.

From-SVN: r159260

gcc/ChangeLog
gcc/cgraph.c

index 3abdc3f5b3b2aaec1ae4ae5a1ba5a07584e6b051..0e02b6c127cd78834846100f65257b5faf271630 100644 (file)
@@ -1,8 +1,8 @@
 2010-05-11  Jan Hubicka  <jh@suse.cz>
 
        * cgraphbuild.c (cgraph_rebuild_references): New.
-       (cgraph_mark_reachable_node): Accept references to optimized out
-       extern inlines.
+       * cgraph.c (cgraph_mark_reachable_node): Accept references to optimized
+       out extern inlines.
        * cgraph.h (cgraph_rebuild_references): Declare.
        * tree-inline.c (tree_function_versioning): Use it.
        * ipa-struct-reorg.c (do_reorg_for_func): Likewise.
index 5f609aaf4341f732b0772bf373a3e2822fd3951d..a6aed42517a2121ce5dd875211a43b388dd2a0e2 100644 (file)
@@ -1643,9 +1643,16 @@ cgraph_mark_reachable_node (struct cgraph_node *node)
 {
   if (!node->reachable && node->local.finalized)
     {
-      notice_global_symbol (node->decl);
+      if (cgraph_global_info_ready)
+        {
+         /* Verify that function does not appear to be needed out of blue
+            during the optimization process.  This can happen for extern
+            inlines when bodies was removed after inlining.  */
+         gcc_assert ((node->analyzed || DECL_EXTERNAL (node->decl)));
+       }
+      else
+        notice_global_symbol (node->decl);
       node->reachable = 1;
-      gcc_assert (!cgraph_global_info_ready);
 
       node->next_needed = cgraph_nodes_queue;
       cgraph_nodes_queue = node;