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 cygnus dot com>
- Subject: Re: Inline limitation?
- From: Nathan Sidwell <nathan at cs dot bris dot ac dot uk>
- Date: Wed, 19 Aug 1998 09:25:56 +0100
- CC: egcs at cygnus dot com
- Organization: Computer Science Dept, Bristol University
- References: <199808171720.KAA30267.cygnus.egcs@iago.ultimatech.com.ultimatech.com> <35DA0251.4083D908@nospam.cantrip.org>
Nathan Myers wrote:
>
> 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.
Yes. Actually I had (erroneously) thought -Winline did this, but not so.
The documentation for -Winline implies that it should,
Warn if a function can not be inlined, and either it was
declared as inline,or else the @samp{-finline-functions}
option was given.
We implemented such a feature on a commercial compiler I was involved
with. To be any use the warning has to be in two parts. First at the
call site indicating where the declaration was as well, and secondly at
the definition site indicating where the first call site was too.
(We did eventually add a 'monster inline' option which delayed code
generation until all inline definitions had been seen -- but that of
course uses a lot of memory.)
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk