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 only previously seen and marked inline function?


> Hi,
> 
>     The following code seems to suggest that egcs only inline a
> function f of class A if either 1) f is defined in class definition,
> or 2) the caller of f is seen by the compiler after f's body is
> defined. For example, if we reverse the order of definition of main()
> and A::Outside() in the following code, A::Outside() would be
> inlined. A::Inside() is always inlined. Can the creators of egcs
> confirm this? It seems to be a limitation because the opportunity to
> inline now strongly depends on how the inline functions are arranged
> in the source file and its includes. Hence the performance of the code
> depends on the order of #include's and the order of function
> definitions in the .cc file.

Yes.
It's the same mechanism that gcc 2.8 uses, so that limitation is not
specific to egcs.


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