OSDN Git Service

* cgraph.c (cgraph_mark_reachable_node): Accept references to optimized
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 08:19:28 +0000 (08:19 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:04:56 +0000 (14:04 +0900)
out extern inlines.

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

gcc/ChangeLog
gcc/cgraph.c

index 3abdc3f..0e02b6c 100644 (file)
@@ -1,8 +1,8 @@
 2010-05-11  Jan Hubicka  <jh@suse.cz>
 
        * cgraphbuild.c (cgraph_rebuild_references): New.
 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.
        * cgraph.h (cgraph_rebuild_references): Declare.
        * tree-inline.c (tree_function_versioning): Use it.
        * ipa-struct-reorg.c (do_reorg_for_func): Likewise.
index 5f609aa..a6aed42 100644 (file)
@@ -1643,9 +1643,16 @@ cgraph_mark_reachable_node (struct cgraph_node *node)
 {
   if (!node->reachable && node->local.finalized)
     {
 {
   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;
       node->reachable = 1;
-      gcc_assert (!cgraph_global_info_ready);
 
       node->next_needed = cgraph_nodes_queue;
       cgraph_nodes_queue = node;
 
       node->next_needed = cgraph_nodes_queue;
       cgraph_nodes_queue = node;