aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
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 db77d12..0b38b4c 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,