summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-13 14:28:03 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-13 14:28:03 +0000
commitce1f57d6312c4a4cbba1f9c616da41b41498cbae (patch)
tree564701a6289b5cb316e4b13742fbef5764b871f0 /gcc/ipa-inline-analysis.c
parent84cb1020e1a532fdd7a3c2fa1508b3734b8ae54d (diff)
downloadgcc-ce1f57d6312c4a4cbba1f9c616da41b41498cbae.tar.gz
* ipa-inline-analysis.c (struct growth_data): Add node.
(do_estimate_growth_1): Fix detection of recursion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202566 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 8cf8253eaca..eaf64d35853 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -3580,6 +3580,7 @@ estimate_size_after_inlining (struct cgraph_node *node,
struct growth_data
{
+ struct cgraph_node *node;
bool self_recursive;
int growth;
};
@@ -3597,9 +3598,9 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data)
{
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 == node))
+ && e->caller->global.inlined_to == d->node))
d->self_recursive = true;
d->growth += estimate_edge_growth (e);
}
@@ -3612,7 +3613,7 @@ do_estimate_growth_1 (struct cgraph_node *node, void *data)
int
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);
cgraph_for_node_and_aliases (node, do_estimate_growth_1, &d, true);