From 8a6295ba053636608ab653b66683cf02a96d7904 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 30 May 2010 10:21:41 +0200 Subject: [PATCH] ipa.c (cgraph_remove_unreachable_node): Walk references of correct node... * ipa.c (cgraph_remove_unreachable_node): Walk references of correct node; remove references in node we no longer keep in cgrpah but need body of. From-SVN: r160046 --- gcc/ChangeLog | 6 ++++++ gcc/ipa.c | 28 ++++++++++++++++------------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf55665bd7f..9d723532dac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-05-29 Jan Hubicka + + * ipa.c (cgraph_remove_unreachable_node): Walk references of correct node; + remove references in node we no longer keep in cgrpah but need body + of. + 2010-05-29 Jan Hubicka * cgraph.c (cgraph_mark_reachable): Relax check for analyzed nodes. diff --git a/gcc/ipa.c b/gcc/ipa.c index ebfc1a20ecd..906fa66d569 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -284,16 +284,19 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) reachable too, unless they are direct calls to extern inline functions we decided to not inline. */ 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)) - { - e->callee->reachable = true; - enqueue_cgraph_node (e->callee, &first); - } + { + 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)) + { + e->callee->reachable = true; + enqueue_cgraph_node (e->callee, &first); + } + process_references (&node->ref_list, &first, &first_varpool, before_inlining_p); + } /* If any function in a comdat group is reachable, force all other functions in the same comdat group to be @@ -316,7 +319,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) function is clone of real clone, we must keep it around in order to make materialize_clones produce function body with the changes applied. */ - while (node->clone_of && !node->clone_of->aux && !gimple_has_body_p (node->decl)) + while (node->clone_of && !node->clone_of->aux + && !gimple_has_body_p (node->decl)) { bool noninline = node->clone_of->decl != node->decl; node = node->clone_of; @@ -326,7 +330,6 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) break; } } - process_references (&node->ref_list, &first, &first_varpool, before_inlining_p); } if (first_varpool != (struct varpool_node *) (void *) 1) { @@ -367,6 +370,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) if (node->aux && !node->reachable) { cgraph_node_remove_callees (node); + ipa_remove_all_references (&node->ref_list); node->analyzed = false; node->local.inlinable = false; } -- 2.30.2