From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10244 invoked by alias); 6 Aug 2003 02:15:24 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10233 invoked from network); 6 Aug 2003 02:15:24 -0000 Received: from unknown (HELO dellpi.pinski.fam) (66.161.249.28) by sources.redhat.com with SMTP; 6 Aug 2003 02:15:24 -0000 Received: from physics.uc.edu (IDENT:pinskia@localhost.pinski.fam [127.0.0.1]) by dellpi.pinski.fam (8.12.2/8.12.1) with ESMTP id h762F7OM028987; Tue, 5 Aug 2003 22:15:07 -0400 (EDT) Date: Wed, 06 Aug 2003 02:31:00 -0000 Subject: Re: On inlining in C++ Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: Andrew Pinski , Geoff Keating , Gabriel Dos Reis , aph@redhat.com, coyote@coyotegulch.com, gcc@gcc.gnu.org To: Joe Buck From: Andrew Pinski In-Reply-To: <20030805190007.A1778@synopsys.com> Message-Id: Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00327.txt.bz2 On Tuesday, Aug 5, 2003, at 22:00 US/Eastern, Joe Buck wrote: > >>> 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 > struct/class > objects with more than one member are passed by reference. (but that macro is not equivalent to that function). > > Compile the following code with "gcc -O2 -S il.C" using the trunk on > x86, > and take a look. The problem is that we prematurely commit the tmp > object > 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 tree-ssa branch, it is not yet but it should be soon. Thanks, Andrew Pinski