From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8409 invoked by alias); 23 Apr 2002 00:49:02 -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 8392 invoked from network); 23 Apr 2002 00:49:00 -0000 Received: from unknown (HELO pinskia.dyndns.org) (66.161.185.64) by sources.redhat.com with SMTP; 23 Apr 2002 00:49:00 -0000 Received: from zhivago.i.pinski.fam (IDENT:root@localhost.pinski.fam [127.0.0.1]) by pinskia.dyndns.org (8.12.1/8.12.1) with ESMTP id g3N0mgop032019; Mon, 22 Apr 2002 20:48:43 -0400 (EDT) Date: Mon, 22 Apr 2002 18:20:00 -0000 Subject: Re: GCC performance regression - up to 20% ? Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v481) Cc: Andreas Jaeger , Jan Hubicka , gcc list To: Michel LESPINASSE From: Andrew Pinski In-Reply-To: <20020423003904.GA26890@zoy.org> Message-Id: Content-Transfer-Encoding: 7bit X-SW-Source: 2002-04/txt/msg01128.txt.bz2 On Monday, April 22, 2002, at 08:39 , Michel LESPINASSE wrote: > On Mon, Apr 22, 2002 at 09:10:55AM +0200, Andreas Jaeger wrote: >> You might want to use the always_inline function attribute for your >> inline functions in 3.1. It makes the inlining unconditional. > > Thanks, that suggestion does solve my inlining problem. I think the > documentation for this option is a bit confusing: it says "For > functions declared inline, this attribute inlines the function even if > no optimization level was specified." which is true I guess, but the > documentation does not mention that when optimization is enabled gcc > will not always inline functions declared inline, unless we use this > attribute. I think the problem is that part of documentation was written before the part about always_inline. > > Also I want to point out that this is a new behaviour, as gcc up to > 3.0.4 apparently always inlined functions declared inline (when > compiling with -O2 at least). Not really new `behavior' was just the inline limit was lowered in 3.0 and above. > > I think either the documentation of always_inline should be made more > clear, or the inline keyword should be made to behave like > always_inline when optimizing with -O2 and above (as it did previously). the inline keyword was always just an hint to the compiler in ISO C++ and ISO C. And it was -O3 that included the inline optimization. Thanks, Andrew Pinski > > -- > Michel "Walken" LESPINASSE > Is this the best that god can do ? Then I'm not impressed. > >