Inline limitation?
Marco Manfai Yu
yumf@ultimatech.com
Wed Aug 19 15:29:00 GMT 1998
> 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
More information about the Gcc
mailing list