summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-02 20:31:21 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-02 20:31:21 +0000
commit9dcc8702456162524e05baaec08dfb1a50b7d95b (patch)
treeee0a53af265611768823eb755d621853a9759d70 /gcc/ipa-inline.c
parentab89cd93a231197c9f8c042e2a60ed007f692252 (diff)
downloadgcc-9dcc8702456162524e05baaec08dfb1a50b7d95b.tar.gz
PR ipa/65130
* ipa-inline.c (check_callers): Looks for recursion. (inline_to_all_callers): Give up on uninlinable or recursive edges. * ipa-inline-analysis.c (inline_summary_t::duplicate): Do not update summary of inline clones. (do_estimate_growth_1): Fix recursion check. * gcc.dg/lto/pr65130_0.c: New testcase. * gcc.dg/lto/pr65130_1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221124 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index db77d12e85f..0b38b4c6225 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -952,6 +952,8 @@ check_callers (struct cgraph_node *node, void *has_hot_call)
return true;
if (!can_inline_edge_p (e, true))
return true;
+ if (e->recursive_p ())
+ return true;
if (!(*(bool *)has_hot_call) && e->maybe_hot_p ())
*(bool *)has_hot_call = true;
}
@@ -2094,6 +2096,15 @@ inline_to_all_callers (struct cgraph_node *node, void *data)
{
struct cgraph_node *caller = node->callers->caller;
+ if (!can_inline_edge_p (node->callers, true)
+ || node->callers->recursive_p ())
+ {
+ if (dump_file)
+ fprintf (dump_file, "Uninlinable call found; giving up.\n");
+ *num_calls = 0;
+ return false;
+ }
+
if (dump_file)
{
fprintf (dump_file,