This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::pow implementation


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]