Commit 1057fc81 by Jan Hubicka

re PR middle-end/28779 (internal compiler error: in…

re PR middle-end/28779 (internal compiler error: in cgraph_estimate_size_after_inlining, at ipa-inline.c:106)

	PR middle-end/28779
	* ipa-inline.c (cgraph_decide_inlining, cgraph_early_inlining): Compute
	function body sizes.
	* cgraphunit.c (cgraph_analyze_function): Don't do so.

From-SVN: r116274
parent 96ddac74
006-08-20 Danny Smith <dannysmith@users.sourceforge.net> 2006-08-20 Jan Hubicka <jh@suse.cz>
PR middle-end/28779
* ipa-inline.c (cgraph_decide_inlining, cgraph_early_inlining): Compute
function body sizes.
* cgraphunit.c (cgraph_analyze_function): Don't do so.
2006-08-20 Danny Smith <dannysmith@users.sourceforge.net>
PR target/28648 c: PR target/28648 c:
* tree.c (handle_dll_attribute): Return early if not a * tree.c (handle_dll_attribute): Return early if not a
......
...@@ -928,7 +928,8 @@ cgraph_analyze_function (struct cgraph_node *node) ...@@ -928,7 +928,8 @@ cgraph_analyze_function (struct cgraph_node *node)
cgraph_create_edges (node, decl); cgraph_create_edges (node, decl);
node->local.inlinable = tree_inlinable_function_p (decl); node->local.inlinable = tree_inlinable_function_p (decl);
node->local.self_insns = estimate_num_insns (decl); if (!flag_unit_at_a_time)
node->local.self_insns = estimate_num_insns (decl);
if (node->local.inlinable) if (node->local.inlinable)
node->local.disregard_inline_limits node->local.disregard_inline_limits
= lang_hooks.tree_inlining.disregard_inline_limits (decl); = lang_hooks.tree_inlining.disregard_inline_limits (decl);
......
...@@ -899,13 +899,23 @@ cgraph_decide_inlining (void) ...@@ -899,13 +899,23 @@ cgraph_decide_inlining (void)
timevar_push (TV_INLINE_HEURISTICS); timevar_push (TV_INLINE_HEURISTICS);
max_count = 0; max_count = 0;
for (node = cgraph_nodes; node; node = node->next) for (node = cgraph_nodes; node; node = node->next)
{ if (node->analyzed && (node->needed || node->reachable))
struct cgraph_edge *e; {
initial_insns += node->local.self_insns; struct cgraph_edge *e;
for (e = node->callees; e; e = e->next_callee)
if (max_count < e->count) /* At the moment, no IPA passes change function bodies before inlining.
max_count = e->count; Save some time by not recomputing function body sizes if early inlining
} already did so. */
if (!flag_early_inlining)
node->local.self_insns = node->global.insns
= estimate_num_insns (node->decl);
initial_insns += node->local.self_insns;
gcc_assert (node->local.self_insns == node->global.insns);
for (e = node->callees; e; e = e->next_callee)
if (max_count < e->count)
max_count = e->count;
}
overall_insns = initial_insns; overall_insns = initial_insns;
gcc_assert (!max_count || (profile_info && flag_branch_probabilities)); gcc_assert (!max_count || (profile_info && flag_branch_probabilities));
...@@ -1180,6 +1190,13 @@ cgraph_early_inlining (void) ...@@ -1180,6 +1190,13 @@ cgraph_early_inlining (void)
for (i = nnodes - 1; i >= 0; i--) for (i = nnodes - 1; i >= 0; i--)
{ {
node = order[i]; node = order[i];
if (node->analyzed && (node->needed || node->reachable))
node->local.self_insns = node->global.insns
= estimate_num_insns (node->decl);
}
for (i = nnodes - 1; i >= 0; i--)
{
node = order[i];
if (node->analyzed && node->local.inlinable if (node->analyzed && node->local.inlinable
&& (node->needed || node->reachable) && (node->needed || node->reachable)
&& node->callers) && node->callers)
......
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