This is the mail archive of the
mailing list for the GCC project.
Re: On inlining in C++
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Joe Buck <jbuck at synopsys dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, Geoff Keating <geoffk at geoffk dot org>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, aph at redhat dot com, coyote at coyotegulch dot com, gcc at gcc dot gnu dot org
- Date: Tue, 5 Aug 2003 22:15:05 -0400
- Subject: Re: On inlining in C++
On Tuesday, Aug 5, 2003, at 22:00 US/Eastern, Joe Buck wrote:
(but that macro is not equivalent to that function).
There are tons of messages in this (or related thread) so it might be
possible that I missed a message that disagreed with the
interpretation of the documentation I quoted. Can you give reference
to such a message?
On Tue, Aug 05, 2003 at 11:16:56AM -0700, Geoff Keating wrote:
I would point out that the documentation says "as fast as a macro",
but it should really say "as fast or faster than a macro".
Ah, but even if we fix the inlining issues, we still aren't keeping the
promise: inline functions are still slower in many cases if
objects with more than one member are passed by reference.
Compile the following code with "gcc -O2 -S il.C" using the trunk on
and take a look. The problem is that we prematurely commit the tmp
to the stack, even though after inlining its address is not taken.
Yes this is a know defect in gcc which should be fixed soon on the
it is not yet but it should be soon.