This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Scott Robert Ladd <coyote at coyotegulch dot com>
- Cc: Rob Taylor <robt at flyingpig dot com>, "Gcc at Gcc dot Gnu. Org" <gcc at gcc dot gnu dot org>
- Date: 31 Jul 2003 15:36:50 +0200
- Subject: Re: std::pow implementation
- Organization: Integrable Solutions
- References: <041f01c3574f$f51e9180$b800a8c0@eventhorizon><3F29159B.8060609@coyotegulch.com>
Scott Robert Ladd <coyote@coyotegulch.com> writes:
| Rob Taylor wrote:
| > 2) every function has to be maybe-inlinable for good optimisation, but the
| > inline keyword gives good hinting and should be used.
|
| That's close to my position on the matter.
|
| 1) The compiler should be able to determine which functions it can
| effectively inline for a given circumstance.
|
| 2) The compiler should respect "inline" directives from the
| programmer, generating inline code when it is specified, unless doing
| so is technically impossible or blatantly inefficient.
|
| 3) If the compiler rejects an "inline" request, it should clearly
| state why it did so. After all, if the compiler is smart enough to
| second-guess me, it should also be able to explain itself. ;)
|
| Such an approach gives the compiler maximum flexibility while
| respecting the choices of the programmer.
that is close to
A function declaration (8.3.5, 9.3, 11.4) with an inline
specifier declares an inline function. The inline specifier
indicates to the implementation that *inline substitution* of the
function body at the point of call *is to be preferred* to the usual
function call mechanism. An implementation is not required to
perform this inline substitution at the point of call;
-- Gaby