diff options
author | Jan Hubicka <jh@suse.cz> | 2010-05-30 10:21:41 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-05-30 08:21:41 +0000 |
commit | 8a6295ba053636608ab653b66683cf02a96d7904 (patch) | |
tree | 4644441f42c6fdb2d584c79dabc38915c21cd455 | |
parent | 450f429348300e614722d03966ce898ab3ffb7f5 (diff) | |
download | gcc-8a6295ba053636608ab653b66683cf02a96d7904.zip gcc-8a6295ba053636608ab653b66683cf02a96d7904.tar.gz gcc-8a6295ba053636608ab653b66683cf02a96d7904.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa.c | 28 |
2 files changed, 22 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf55665..9d72353 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2010-05-29 Jan Hubicka <jh@suse.cz> + * 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 <jh@suse.cz> + * cgraph.c (cgraph_mark_reachable): Relax check for analyzed nodes. 2010-05-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> @@ -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; } |