This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gdr at integrable-solutions dot net, <Richard dot Earnshaw at arm dot com>, <aoliva at redhat dot com>, <gcc at gcc dot gnu dot org>, <kgardas at objectsecurity dot com>
- Date: Wed, 30 Jul 2003 16:23:50 +0200 (CEST)
- Subject: Re: std::pow implementation
On Wed, 30 Jul 2003, Robert Dewar wrote:
> > The only sane possible semantics I see are:
> >
> > 1. inline declared functions are inlined always if technically possible
> > 2. the inline keyword has no effect
> > 3. inline is handled in an implementation defined manner (as stated in the
> > standard), maybe by adjusting the set of functions considered for inlining,
> > as gcc does.
>
> None of these three semantics make sense to me. The only one that makes sense
> is the one I gave before.
These are clearly defined semantics suitable for a standards document,
yours below falls to #3, obviously.
> Speed up calls to this function, by doing optimizations (most obviously by
> inlining the call) that speed up execution, even if it results in extra space
> for generated code.
This is of course what we have in mind if specifying "inline". But I would
expect the compiler doing similar things if only specifying -O2 globally
and not -Os.
Richard.