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


Alexandre Oliva wrote:
Therefore, inline the way you describe it, is useful only for functions that are *always* profitable to inline. Any function that might or might not be profitable to inline should not be declared inline, and the compiler would never inline it. This sounds silly to
me. Why not let the user tell the compiler `hey, look, this
function is probably worth trying to inline', but letting the
compiler decide whether it's actually profitable or not, depending
not only on the context, but also on machine-dependent features?

IMNSHO, the keyword "inline" means precisely what it says: to inline the code for a given function, if possible.

You are applying a different semantic concept to "inline" -- you want a
keyword that says "make this function as efficient as possible when
used". As such, it would be better to have a new keyword -- say
"optimize" -- that identifies a function important to performance,
explicitly handing decisions to the compiler.

"Inline", however, has a very precise and direct meaning, and it should
be fuddled with imprecise expectations.

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


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