systimer01.patch available for review.

Joerg Sonnenberger joerg at britannica.bec.de
Thu Jan 29 09:49:05 PST 2004


On Thu, Jan 29, 2004 at 07:20:53PM +0200, Alex Keahan wrote:
> Actually, there's nothing fundamental to prevent the compiler from
> inlining a function if the source is not in the file being compiled.

Well, there is. At least with the way the compiler is currently invoced.
It can be done with a better compiler doing e.g. IPC analysis and the
like, but that's something GCC is very bad at ATM.

> In fact, Sun's Forte C compiler can optimise and inline functions across
> multiple source files.   With -xcrossfile, Sun CC analyses all the files
> named on the command line as if they were a single source file.
> 
> Of course, this affects the way Makefiles are constructed, because
> the files produced from cross-compilation must be used as one unit when
> linking into a program.   In particular, if one function is changed, all
> the files must be recompiled (due to possible inlining
> interdependencies).

Even better optimizations are possible with explicit lists of public
symbols. This allows optimizations GCC 3.4 will do for static functions
not referenced via pointer.

Joerg

> AK

P.S.: Does anyone else get line-wrapped mail headers e.g. for mail I
answered? In general I get this behaviour for most message which seems
to come via NNTP ;-) I'm not sure wether this is getmail/maildrop or the
the gateway.





More information about the Kernel mailing list