+2015-03-02 Jan Hubicka <hubicka@ucw.cz>
+
+ 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.
+
2015-03-02 Jan Hubicka <hubicka@ucw.cz>
PR ipa/64988
set_hint_predicate (&info->array_index, p);
}
}
- inline_update_overall_summary (dst);
+ if (!dst->global.inlined_to)
+ inline_update_overall_summary (dst);
}
continue;
}
- if (e->caller == d->node
- || (e->caller->global.inlined_to
- && e->caller->global.inlined_to == d->node))
- d->self_recursive = true;
+ if (e->recursive_p ())
+ {
+ d->self_recursive = true;
+ continue;
+ }
d->growth += estimate_edge_growth (e);
}
return false;
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;
}
{
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,
+2015-03-02 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65130
+ * gcc.dg/lto/pr65130_0.c: New testcase.
+ * gcc.dg/lto/pr65130_1.c: New testcase.
+
2015-03-02 Jan Hubicka <hubicka@ucw.cz>
PR ipa/64988
--- /dev/null
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -O1 -fdevirtualize } } } */
+extern void fn3 (void);
+
+void fn2(void)
+{
+ fn3();
+}
+
+void fn1(void)
+{
+ fn2();
+}
+
+void fn4(void)
+{
+ fn2();
+}
+
--- /dev/null
+/* { dg-options "-O2 -fdevirtualize" } */
+extern void fn1(void);
+extern void fn4 (void);
+
+int a;
+
+void fn3(void)
+{
+ for (; a;)
+ fn4();
+}
+
+int main() {
+ fn1();
+ return 0;
+}
+