aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-03-14 09:57:43 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-03-14 09:57:43 +0000
commit6971d714fe697f099327fcfac909497e1a7e906d (patch)
tree6a67f9a43b1a56c8f6f35b5469c6f0d4e28d8e3a /gcc/ipa-inline.c
parent7de805590acbbcce1968a6552950b189946d852f (diff)
downloadgcc-6971d714fe697f099327fcfac909497e1a7e906d.zip
gcc-6971d714fe697f099327fcfac909497e1a7e906d.tar.gz
gcc-6971d714fe697f099327fcfac909497e1a7e906d.tar.bz2
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
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 9ba2f10..4765b00 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -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)