This is the mail archive of the
mailing list for the GCC project.
Re: std::pow implementation
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- Cc: Martin Reinecke <martin at MPA-Garching dot MPG dot DE>, gcc at gcc dot gnu dot org
- Date: 04 Aug 2003 14:54:58 +0200
- Subject: Re: std::pow implementation
- Organization: Integrable Solutions
- References: <200308041235.h74CZbpw004365@mururoa.inria.fr>
Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> writes:
| Sorry, I'm certainly replying a bit late...
| email@example.com said:
| > | > It suffices to point out that (defunct) KCC did outperform GCC on most
| > | > real world code.
| > |
| > | But surely not due to honouring the inline keyword.
| > Its honouring the inline keyword was most certainly part of that.
| Well to be honest at the time the inline-limit was put into gcc, gcc
| was much better than KCC (in terms of inlining not in terms of
| overall efficiency of the compiled code).
As I noted elswhere, just inlining does not solve all problems. There
is no dispute on that. But KCC's honouring the inline keyword was
most certainly part of the efficacy of codes produced by KCC.
Inlining can expose opportunities for better optimization, like
constant propagation, dead code elimination or reference shrinking.
| Then a lot of things changed, garbage collection was introduced, tree
| based inlining was introduced, function-at-a-time and now even
| unit-at-a-time strategy, a new standard C++ library came in, ...
listing the (new) standard library in this discussion will create more
confusion than helps sort out the issue.
| So saying that KCC was better than gcc because it inlined more was
| simply not true (at the time where this story begins), KCC was still
| often better than gcc and gcc was inlining everything it could (ie
| marked as inline either explicit or implicit).
Please do be careful in your rephrasing. I'm specifically concerned
about honouring the inline request and -not- "inlining more". And I'm
not saying GCC should inline everything. Part of the confusion in
this debate came from the fact that people are considering that
honouring the inline request means inlining everything.
| - The inlining strategy plays some important role. In the function
Equally important is considering the language-specific semantics.
| Final point: it has been reported here (and it is also my
| experience), that for some C++ code, sometimes -Os (which I believe
| restricts the amount of inlining) results with more efficient code
| than all over -O choices.
You seem to be confusing "inline" with "optimize".
| - certainly, at some point the compiler will know better what to
at that point, "inline" could go the way of "register", but we're
not at that level yet.
I'll send in a moment a text I intended to send some time ago.