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


Steven Bosscher wrote:
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.

I thought that the whole point in this discussion is that some people argue that the compiler cannot know when inlining an `inline' declared function is blatantly inefficient.

A decent compiler should be able to recognize patterns (e.g., big functions that can't be reduced) that render inlining inefficient. And rejecting silly (i.e., undefined) requests, such as inlining "main", is to be expected.


In an ideal universe, explicit "inline" shouldn't be required (or even desirable.) Alas, current compiler technology is far from that ideal, and so responsibility for intelligent choices should fall to the programmer, not the compiler.

--
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]