Commit 6971d714 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/26667 (Inlining always_inline functions causes further…

re PR tree-optimization/26667 (Inlining always_inline functions causes further inlining that reduces function size to fail)

2006-03-14  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/26667
	* ipa-inline.c (cgraph_check_inline_limits): Walk the correct
	node for the callees.  Always allow inlining if it will shrink
	the function size.

From-SVN: r112049
parent 7de80559
2006-03-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26667
* ipa-inline.c (cgraph_check_inline_limits): Walk the correct
node for the callees. Always allow inlining if it will shrink
the function size.
2006-03-14 Richard Guenther <rguenther@suse.de>
PR middle-end/26659
* builtins.c (get_pointer_alignment): Prefer alignment
information from decls over that from types.
......
......@@ -254,13 +254,13 @@ cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what,
int newsize;
int limit;
if (to->global.inlined_to)
to = to->global.inlined_to;
for (e = to->callees; e; e = e->next_callee)
if (e->callee == what)
times++;
if (to->global.inlined_to)
to = to->global.inlined_to;
/* When inlining large function body called once into small function,
take the inlined function as base for limiting the growth. */
if (to->local.self_insns > what->local.self_insns)
......@@ -270,8 +270,11 @@ cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what,
limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100;
/* Check the size after inlining against the function limits. But allow
the function to shrink if it went over the limits by forced inlining. */
newsize = cgraph_estimate_size_after_inlining (times, to, what);
if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS)
if (newsize >= to->global.insns
&& newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS)
&& newsize > limit)
{
if (reason)
......
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