This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Inline limits
- From: Hariharan <hariharans at picochip dot com>
- To: rguenther at suse dot de, jh at suse dot cz, gcc at gcc dot gnu dot org
- Date: Mon, 26 Jan 2009 16:29:07 +0000
- Subject: Inline limits
Hi,
I ran into some code-size/stack size bloat using -Os for a piece of
code. This seemed to happen only when certain single call-site functions
are defined "static" and not otherwise. On investigating further on
this, i see that the inline_functions_called_once seems to rely only on
"cgraph_check_inline_limits", whereas other inlining code go through
more rigorous cost-benefit analysis to decide on inlining (especially
with INLINE_SIZE).
I have been looking at re-setting some of the parameters used in
"cgraph_check_inline_limits" for inlining for picochip. I could not
understand the way PARAM_LARGE_FUNCTION_GROWTH and
PARAM_STACK_FRAME_GROWTH are used in this function. Both of these
parameters are used as a fraction of the bigger (or to) function.
I want to be able to say, if the inlining would increase the code size
or stack frame size, dont inline. Otherwise, go ahead an inline. Of
course, i am compiling this code at -Os, so this condition is probably
obvious. Can you advice me on how to use these parameters to do that?
A side question... Are 'static' single call-site functions always
inlined? I would hope not (under -Os), but just checking.
Thanks
Hari
PS: If this were to be considered a "bug", i will file a report with a
testcase.