Commit a93c18c8 by Jan Hubicka Committed by Jan Hubicka

ipa-inline-analysis.c (struct growth_data): Add node.

	* ipa-inline-analysis.c (struct growth_data): Add node.
	(do_estimate_growth_1): Fix detection of recursion.

From-SVN: r202566
parent f3b331d1
2013-09-13 Jan Hubicka <jh@suse.cz>
* ipa-inline-analysis.c (struct growth_data): Add node.
(do_estimate_growth_1): Fix detection of recursion.
2013-09-13 Jakub Jelinek <jakub@redhat.com> 2013-09-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58392 PR tree-optimization/58392
......
...@@ -3580,6 +3580,7 @@ estimate_size_after_inlining (struct cgraph_node *node, ...@@ -3580,6 +3580,7 @@ estimate_size_after_inlining (struct cgraph_node *node,
struct growth_data struct growth_data
{ {
struct cgraph_node *node;
bool self_recursive; bool self_recursive;
int growth; int growth;
}; };
...@@ -3597,9 +3598,9 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data) ...@@ -3597,9 +3598,9 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data)
{ {
gcc_checking_assert (e->inline_failed); gcc_checking_assert (e->inline_failed);
if (e->caller == node if (e->caller == d->node
|| (e->caller->global.inlined_to || (e->caller->global.inlined_to
&& e->caller->global.inlined_to == node)) && e->caller->global.inlined_to == d->node))
d->self_recursive = true; d->self_recursive = true;
d->growth += estimate_edge_growth (e); d->growth += estimate_edge_growth (e);
} }
...@@ -3612,7 +3613,7 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data) ...@@ -3612,7 +3613,7 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data)
int int
do_estimate_growth (struct cgraph_node *node) do_estimate_growth (struct cgraph_node *node)
{ {
struct growth_data d = { 0, false }; struct growth_data d = { node, 0, false };
struct inline_summary *info = inline_summary (node); struct inline_summary *info = inline_summary (node);
cgraph_for_node_and_aliases (node, do_estimate_growth_1, &d, true); cgraph_for_node_and_aliases (node, do_estimate_growth_1, &d, true);
......
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