This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Os & inlining functions used only once


>>> "Joe" == Joe Buck <jbuck@racerx.synopsys.com> writes:

[...]

 Joe> The compiler can't possibly tell that a static function is
 Joe> used only once until it gets to the end of a compilation
 Joe> unit, and compilation units can be arbitrarily large.  The
 Joe> compiler does not pre-scan the whole file and then go back
 Joe> and compile, so it can't do what you are asking for.  It
 Joe> only deals with one function at a time, and doesn't make
 Joe> assumptions about what future functions will do.

Ah, that makes sense.  So I'll pre-scan the file myself and mark
those functions 'inline' :)

[...]

Thanks for your quick answer.
-- 
Alexandre Duret-Lutz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]