This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inline limitation?
- To: Nathan Myers <ncm at nospam dot cantrip dot org>
- Subject: Re: Inline limitation?
- From: Marco Manfai Yu <yumf at ultimatech dot com>
- Date: Wed, 19 Aug 1998 09:53:16 -0700
- cc: egcs at cygnus dot com
> 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