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: Inline limitation?



> Marco Manfai Yu wrote:
> 
> >     It seems that egcs 1.0.3a does not inline a function unless
> > it is defined before use.
> 
> This is conventional.  The compiler is permitted to inline it (or
> any function, inline or otherwise) or not.  
> 
> Perhaps there should be an optional warning that an inline function 
> is not available for inlining at the point where it is called.
> 
> Nathan Myers
> ncm@cygnus.com

There is such a warning, -Winline. I am not a compiler guru so I don't
know how difficult it is to do inline regardless of the order of
definition and use of functions. I know that our Sun C++ Version 4.2
does inlining regardless of the order of definition.

This is very helpful in C++ because there are a lot of short,
inlinable functions but the order of #includes forbids a
define-before-use ordering. So egcs is losing a big opportunity
to optimize here.

Marco Yu
yumf@ultimatech.com


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