warning about 'large-function-growth limit reached'

Dmitri Nikulin dnikulin at gmail.com
Thu Jun 15 08:02:52 PDT 2006

On 6/16/06, Richard Tobin <richard at xxxxxxxxxxxx> wrote:
> Either way inlining is overrated unless the function is
> both extremely small and frequently used, and yet still too messy to
> make a macro.
That depends on how you measure "small".  A function consisting of
a hundred-case switch, with most of the cases very small (e.g. a
virtual machine) might well be worth inlining.
Good point! I should have specified as "short effective length for any
call". The question then is, what will gcc do? If the call is constant
it could remove all but one case, but otherwise it will end up just
folding the whole switch in, which will almost certainly cross its
inlining threshold. I've been able to cross the default threshold of
gcc 3.3 with barely 30 lines of effective code (some of it folded into
one-liners so the actual was smaller). That's nowhere near a hundred
cases of VM operations. Out of curiosity, is ANY VM instruction set as
expansive as 100 opcodes?
 -- Dmitri Nikulin

More information about the Kernel mailing list