This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inline only previously seen and marked inline function?
- To: yumf at cygnus dot co dot uk (Marco Man-Fai Yu)
- Subject: Re: Inline only previously seen and marked inline function?
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Mon, 17 Aug 1998 12:38:24 +0100 (BST)
- Cc: egcs at cygnus dot com, yumf at ultiamtech dot com
> 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.