Commit e3c7b49c by Jan Hubicka Committed by Jan Hubicka

ipa-inline.c (ipa_inline): Avoid infinite loop on inlining empty virtual…

ipa-inline.c (ipa_inline): Avoid infinite loop on inlining empty virtual functions calling themselves.


	* ipa-inline.c (ipa_inline): Avoid infinite loop on inlining
	empty virtual functions calling themselves.

From-SVN: r193038
parent 737df6e6
2012-10-31 Jan Hubicka <jh@suse.cz>
* ipa-inline.c (ipa_inline): Avoid infinite loop on inlining
empty virtual functions calling themselves.
2012-10-31 Tom Tromey <tromey@redhat.com> 2012-10-31 Tom Tromey <tromey@redhat.com>
PR other/50899 PR other/50899
...@@ -1767,29 +1767,41 @@ ipa_inline (void) ...@@ -1767,29 +1767,41 @@ ipa_inline (void)
FOR_EACH_DEFINED_FUNCTION (node) FOR_EACH_DEFINED_FUNCTION (node)
{ {
if (want_inline_function_to_all_callers_p (node, cold)) if (want_inline_function_to_all_callers_p (node, cold))
while (node->callers && !node->global.inlined_to) {
{ int num_calls = 0;
struct cgraph_node *caller = node->callers->caller; struct cgraph_edge *e;
for (e = node->callers; e; e = e->next_caller)
if (dump_file) num_calls++;
{ while (node->callers && !node->global.inlined_to)
{
struct cgraph_node *caller = node->callers->caller;
if (dump_file)
{
fprintf (dump_file,
"\nInlining %s size %i.\n",
cgraph_node_name (node),
inline_summary (node)->size);
fprintf (dump_file,
" Called once from %s %i insns.\n",
cgraph_node_name (node->callers->caller),
inline_summary (node->callers->caller)->size);
}
inline_call (node->callers, true, NULL, NULL, true);
if (dump_file)
fprintf (dump_file, fprintf (dump_file,
"\nInlining %s size %i.\n", " Inlined into %s which now has %i size\n",
cgraph_node_name (node), cgraph_node_name (caller),
inline_summary (node)->size); inline_summary (caller)->size);
fprintf (dump_file, if (!num_calls--)
" Called once from %s %i insns.\n", {
cgraph_node_name (node->callers->caller), if (dump_file)
inline_summary (node->callers->caller)->size); fprintf (dump_file, "New calls found; giving up.\n");
} break;
}
inline_call (node->callers, true, NULL, NULL, true); }
if (dump_file) }
fprintf (dump_file,
" Inlined into %s which now has %i size\n",
cgraph_node_name (caller),
inline_summary (caller)->size);
}
} }
} }
} }
......
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