OSDN Git Service

* ipa.c (process_references): Enqueue all referenced nodes;
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Oct 2010 22:42:53 +0000 (22:42 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Oct 2010 22:42:53 +0000 (22:42 +0000)
mark as reachable only non-external nodes.
(cgraph_remove_unreachable_nodes): All referenced nodes should
be enqueued; remove bogues node->needed check.

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

gcc/ChangeLog
gcc/ipa.c

index 152c279..7c6b89a 100644 (file)
@@ -1,14 +1,14 @@
 2010-10-26  Jan Hubicka  <jh@suse.cz>
 
-       * cgraphbuild.c (build_cgraph_edges): Use ipa-reference to represent OMP.
-
-2010-10-26  Jan Hubicka  <jh@suse.cz>
-
        * ipa.c (process_references): Enqueue all referenced nodes;
        mark as reachable only non-external nodes.
        (cgraph_remove_unreachable_nodes): All referenced nodes should
        be enqueued; remove bogues node->needed check.
 
+2010-10-26  Jan Hubicka  <jh@suse.cz>
+
+       * cgraphbuild.c (build_cgraph_edges): Use ipa-reference to represent OMP.
+
 2010-10-26  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.md (split_stack_return): Replace
index c318b65..7c2c7f2 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -170,12 +170,11 @@ process_references (struct ipa_ref_list *list,
        {
          struct cgraph_node *node = ipa_ref_node (ref);
          if (!node->reachable
+             && node->analyzed
              && (!DECL_EXTERNAL (node->decl)
                  || before_inlining_p))
-           {
-             node->reachable = true;
-             enqueue_cgraph_node (node, first);
-           }
+           node->reachable = true;
+         enqueue_cgraph_node (node, first);
        }
       else
        {
@@ -304,15 +303,15 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
          if (node->reachable)
            {
              for (e = node->callees; e; e = e->next_callee)
-               if (!e->callee->reachable
-                   && node->analyzed
-                   && (!e->inline_failed || !e->callee->analyzed
-                       || (!DECL_EXTERNAL (e->callee->decl))
-                       || before_inlining_p))
-                 {
+               {
+                 if (!e->callee->reachable
+                     && node->analyzed
+                     && (!e->inline_failed
+                         || !DECL_EXTERNAL (e->callee->decl)
+                         || before_inlining_p))
                    e->callee->reachable = true;
-                   enqueue_cgraph_node (e->callee, &first);
-                 }
+                 enqueue_cgraph_node (e->callee, &first);
+               }
              process_references (&node->ref_list, &first, &first_varpool, before_inlining_p);
            }
 
@@ -416,7 +415,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
              found = true;
 
          /* If so, we need to keep node in the callgraph.  */
-         if (found || node->needed)
+         if (found)
            {
              if (node->analyzed)
                {