This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Scott Robert Ladd <coyote at coyotegulch dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, Alexandre Oliva <aoliva at redhat dot com>, Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>,gcc at gcc dot gnu dot org
- Date: Wed, 30 Jul 2003 12:48:25 -0400
- Subject: Re: std::pow implementation
- References: <200307301629.h6UGTBk21027@pc960.cambridge.arm.com>
Richard Earnshaw wrote:
When I say "inline", I mean inline, regardless of other opinions
(including those of the compiler).
Really? And when you say "register" do you really mean that? If so,
then I'm sorry, but you are in for a big disappointment when using
gcc -- it completely ignores the register keyword when optimizing and
has done since ~forever.
Yes -- but as others have pointed out, automatic register allocation is
a well-defined discipline that has proven itself. I have seen much
evidence (including the original basis for this thread) that automatic
inliners are still primitive.
One root of this dicussion is differences in definitions (and
expectations) between C, Ada, and C++.
I've already given examples of when the compiler can make use of
context to give better inlining than can be determined statically.
Your "arrogant" assertion that inline must always and unconditionally
mean inline impliess that programmers can never take advantage of
those cases.
No; I imply that a C++ compiler should do as it's told, and explain
itself when it makes a contrary decision. I don't doubt that the
compiler can find optimizations that are beyond my analysis; I also know
compilers can (and do) generate bad code.
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing