Commit f6e809c8 by Jan Hubicka Committed by Jan Hubicka

re PR ipa/85051 (ICE: in edge_badness, at ipa-inline.c:1035 with flattening recursive calls)


	PR ipa/85051
	* ipa-inline.c (flatten_function): New parameter UPDATE.
	(ipa_inline, early_inliner): Use it.

From-SVN: r270446
parent 7f0964e6
2019-04-18 Jan Hubicka <hubicka@ucw.cz>
PR ipa/85051
* ipa-inline.c (flatten_function): New parameter UPDATE.
(ipa_inline, early_inliner): Use it.
2019-04-18 Richard Sandiford <richard.sandiford@arm.com> 2019-04-18 Richard Sandiford <richard.sandiford@arm.com>
* fold-const.c (int_const_binop): Return early on failure. * fold-const.c (int_const_binop): Return early on failure.
......
...@@ -2134,7 +2134,7 @@ inline_small_functions (void) ...@@ -2134,7 +2134,7 @@ inline_small_functions (void)
at IPA inlining time. */ at IPA inlining time. */
static void static void
flatten_function (struct cgraph_node *node, bool early) flatten_function (struct cgraph_node *node, bool early, bool update)
{ {
struct cgraph_edge *e; struct cgraph_edge *e;
...@@ -2164,7 +2164,7 @@ flatten_function (struct cgraph_node *node, bool early) ...@@ -2164,7 +2164,7 @@ flatten_function (struct cgraph_node *node, bool early)
it in order to fully flatten the leaves. */ it in order to fully flatten the leaves. */
if (!e->inline_failed) if (!e->inline_failed)
{ {
flatten_function (callee, early); flatten_function (callee, early, false);
continue; continue;
} }
...@@ -2204,14 +2204,15 @@ flatten_function (struct cgraph_node *node, bool early) ...@@ -2204,14 +2204,15 @@ flatten_function (struct cgraph_node *node, bool early)
inline_call (e, true, NULL, NULL, false); inline_call (e, true, NULL, NULL, false);
if (e->callee != orig_callee) if (e->callee != orig_callee)
orig_callee->aux = (void *) node; orig_callee->aux = (void *) node;
flatten_function (e->callee, early); flatten_function (e->callee, early, false);
if (e->callee != orig_callee) if (e->callee != orig_callee)
orig_callee->aux = NULL; orig_callee->aux = NULL;
} }
node->aux = NULL; node->aux = NULL;
if (!node->global.inlined_to) if (update)
ipa_update_overall_fn_summary (node); ipa_update_overall_fn_summary (node->global.inlined_to
? node->global.inlined_to : node);
} }
/* Inline NODE to all callers. Worker for cgraph_for_node_and_aliases. /* Inline NODE to all callers. Worker for cgraph_for_node_and_aliases.
...@@ -2519,7 +2520,7 @@ ipa_inline (void) ...@@ -2519,7 +2520,7 @@ ipa_inline (void)
function. */ function. */
if (dump_file) if (dump_file)
fprintf (dump_file, "Flattening %s\n", node->name ()); fprintf (dump_file, "Flattening %s\n", node->name ());
flatten_function (node, false); flatten_function (node, false, true);
} }
if (j < nnodes - 2) if (j < nnodes - 2)
...@@ -2782,7 +2783,7 @@ early_inliner (function *fun) ...@@ -2782,7 +2783,7 @@ early_inliner (function *fun)
if (dump_enabled_p ()) if (dump_enabled_p ())
dump_printf (MSG_OPTIMIZED_LOCATIONS, dump_printf (MSG_OPTIMIZED_LOCATIONS,
"Flattening %C\n", node); "Flattening %C\n", node);
flatten_function (node, true); flatten_function (node, true, true);
inlined = true; inlined = true;
} }
else else
......
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