aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-05-01 21:11:07 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-05-01 19:11:07 +0000
commit09dfe187f0fbc756826672f79495bd3d5c142f78 (patch)
treea8895ae3de3bfde152ef04c6c346ed4c3be37327 /gcc/ipa-inline.c
parent12c0e3856baf63f933061aacd4f70cd865913ab1 (diff)
downloadgcc-09dfe187f0fbc756826672f79495bd3d5c142f78.zip
gcc-09dfe187f0fbc756826672f79495bd3d5c142f78.tar.gz
gcc-09dfe187f0fbc756826672f79495bd3d5c142f78.tar.bz2
ipa-inline.c (caller_growth_limits): Fix thinko when
* ipa-inline.c (caller_growth_limits): Fix thinko when * ipa-inline.c (caller_growth_limits): Fix thinko when looking for largest stack frame. * ipa-inline.h (dump_inline_summary): Declare. * ipa-inline-analysis.c (dump_inline_edge_summary): Dump info on stack usage. (dump_inline_summary): Export. (debug_inline_summary): Declare as DEBUG_FUNCTION. From-SVN: r173234
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 4665c82..437f6b2 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -151,7 +151,7 @@ caller_growth_limits (struct cgraph_edge *e)
we immediately inline to. This is the most relaxed
interpretation of the rule "do not grow large functions
too much in order to prevent compiler from exploding". */
- do
+ while (true)
{
info = inline_summary (to);
if (limit < info->self_size)
@@ -160,8 +160,9 @@ caller_growth_limits (struct cgraph_edge *e)
stack_size_limit = info->estimated_self_stack_size;
if (to->global.inlined_to)
to = to->callers->caller;
+ else
+ break;
}
- while (to->global.inlined_to);
what_info = inline_summary (what);
@@ -181,12 +182,15 @@ caller_growth_limits (struct cgraph_edge *e)
return false;
}
+ if (!what_info->estimated_stack_size)
+ return true;
+
/* FIXME: Stack size limit often prevents inlining in Fortran programs
due to large i/o datastructures used by the Fortran front-end.
We ought to ignore this limit when we know that the edge is executed
on every invocation of the caller (i.e. its call statement dominates
exit block). We do not track this information, yet. */
- stack_size_limit += (stack_size_limit
+ stack_size_limit += ((gcov_type)stack_size_limit
* PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) / 100);
inlined_stack = (outer_info->stack_frame_offset