Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers

Krzysztof Halasa
2006-01-02T19:59:24Z

Linus Torvalds <torvalds@osdl.org> writes:

> That's actually not a good practice. Two reasons:
>
> - debuggability goes way down. Oops reports give a much nicer call-chain
> and better locality for uninlined code.

Right.

> - Gcc can suck at big functions with lots of local variables. A
> function call can be _cheaper_ than trying to inline a function,
> regardless of whether it's called once or many times. I've seen
> functions that had several silly (and unnecessary) spills suddenly
> become quite readable when they were separate functions.

OTOH inlining helps much if both the caller and the called share the
same variables (values, calculated the same way from the same arguments).
--
Krzysztof Halasa