From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17436 invoked by alias); 6 Aug 2003 02:03:25 -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 17407 invoked from network); 6 Aug 2003 02:03:23 -0000 Received: from unknown (HELO ams003.ftl.affinity.com) (216.219.253.199) by sources.redhat.com with SMTP; 6 Aug 2003 02:03:23 -0000 Received: from coyotegulch.com ([68.200.44.160]) by ams.ftl.affinity.com with ESMTP id <213855-23853>; Tue, 5 Aug 2003 22:03:00 -0400 Message-ID: <3F3061D1.2030609@coyotegulch.com> Date: Wed, 06 Aug 2003 02:20:00 -0000 From: Scott Robert Ladd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030714 Debian/1.4-2 X-Accept-Language: en MIME-Version: 1.0 To: Joe Buck CC: Mike Stump , Gabriel Dos Reis , gcc@gcc.gnu.org Subject: Re: On inlining in C++ References: <90BBCFD4-C78D-11D7-A9D4-003065A77310@apple.com> <20030805183421.D27614@synopsys.com> In-Reply-To: <20030805183421.D27614@synopsys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00326.txt.bz2 Joe Buck wrote: > For -O3, try what you want, and maybe I could recommend its use someday, > but not for 3.2 or 3.3 and C++. For evidence why, I suggest looking at a > recent speed comparison between Gentoo and Debian versions of a number of > apps: why did Gentoo come out slower despite its custom optimizations? My > theory: -O3. I ran into precisely the behavior you describe above: -O3 produces slower code than -O2 in several cases. For example, on my C benchmark of Huffman compression (lots of bit manipulations and small loops), run on a 2.8GHz Pentium 4 hardware with gcc 3.2.2: options time (secs) ------- ----------- n/a 44.4 -Os 28.4 -O1 26.3 -O2 30.2 -O3 30.7 Using -funroll-all-loops and other options can bring the run-time down to under 24 seconds. I'm still investigating how various "inline" settings affect the outcome; on preliminary tests, -finline-functions is definitely a loser. I've been distracted by paying work (silly me!), but I'll try to get my results into coherent form in the coming days. I probably need to run tests for GCC 3.4, too... -- Scott Robert Ladd Coyote Gulch Productions (http://www.coyotegulch.com) Software Invention for High-Performance Computing