std::pow implementation

Scott Robert Ladd coyote@coyotegulch.com
Thu Jul 31 14:13:00 GMT 2003


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.

-- 
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing



More information about the Gcc mailing list