Commit 8a6295ba by Jan Hubicka Committed by Jan Hubicka

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
parent 450f4293
2010-05-29 Jan Hubicka <jh@suse.cz> 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. * cgraph.c (cgraph_mark_reachable): Relax check for analyzed nodes.
2010-05-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 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) ...@@ -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 reachable too, unless they are direct calls to extern inline functions
we decided to not inline. */ we decided to not inline. */
if (node->reachable) if (node->reachable)
for (e = node->callees; e; e = e->next_callee) {
if (!e->callee->reachable for (e = node->callees; e; e = e->next_callee)
&& node->analyzed if (!e->callee->reachable
&& (!e->inline_failed || !e->callee->analyzed && node->analyzed
|| (!DECL_EXTERNAL (e->callee->decl)) && (!e->inline_failed || !e->callee->analyzed
|| before_inlining_p)) || (!DECL_EXTERNAL (e->callee->decl))
{ || before_inlining_p))
e->callee->reachable = true; {
enqueue_cgraph_node (e->callee, &first); 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 /* If any function in a comdat group is reachable, force
all other functions in the same comdat group to be all other functions in the same comdat group to be
...@@ -316,7 +319,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) ...@@ -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 function is clone of real clone, we must keep it around in order to
make materialize_clones produce function body with the changes make materialize_clones produce function body with the changes
applied. */ 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; bool noninline = node->clone_of->decl != node->decl;
node = node->clone_of; node = node->clone_of;
...@@ -326,7 +330,6 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) ...@@ -326,7 +330,6 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
break; break;
} }
} }
process_references (&node->ref_list, &first, &first_varpool, before_inlining_p);
} }
if (first_varpool != (struct varpool_node *) (void *) 1) if (first_varpool != (struct varpool_node *) (void *) 1)
{ {
...@@ -367,6 +370,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) ...@@ -367,6 +370,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (node->aux && !node->reachable) if (node->aux && !node->reachable)
{ {
cgraph_node_remove_callees (node); cgraph_node_remove_callees (node);
ipa_remove_all_references (&node->ref_list);
node->analyzed = false; node->analyzed = false;
node->local.inlinable = false; node->local.inlinable = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment