From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30811 invoked by alias); 29 May 2007 16:10:07 -0000 Received: (qmail 30712 invoked by uid 22791); 29 May 2007 16:10:07 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 May 2007 16:10:05 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.1/8.13.1) with ESMTP id l4TG9XcB010006 for ; Tue, 29 May 2007 12:09:33 -0400 Received: from zebedee.littlepinkcloud.COM (vpn-14-90.rdu.redhat.com [10.11.14.90]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l4TG9PdX017232; Tue, 29 May 2007 12:09:27 -0400 Received: from littlepinkcloud.COM (localhost.localdomain [127.0.0.1]) by zebedee.littlepinkcloud.COM (8.13.8/8.13.5) with ESMTP id l4TG9M8n027792; Tue, 29 May 2007 17:09:23 +0100 Received: (from aph@localhost) by littlepinkcloud.COM (8.13.8/8.13.5/Submit) id l4TG9MJA027789; Tue, 29 May 2007 17:09:22 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18012.20529.876334.637871@zebedee.pink> Date: Tue, 29 May 2007 23:39:00 -0000 From: Andrew Haley To: "Barak A. Pearlmutter" Cc: gcc-help@gcc.gnu.org Subject: Re: Bizarrely Poor Code from Bizarre Machine-Generated C Sources In-Reply-To: References: X-Mailer: VM 7.19 under Emacs 22.0.93.1 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00301.txt.bz2 Barak A. Pearlmutter writes: > Success! > > Some working magic seems to be this: > > gcc -s -o particle1 \ > -O3 \ > -march=k8 \ > -mfpmath=sse \ > -finline-limit=100000 \ > --param large-function-insns=1000000 \ > --param inline-unit-growth=1000000 \ > --param sra-field-structure-ratio=0 \ > particle1.c -lm > > although it looks like -Os gives an additional improvement. > > This (with GCC 4.1) reduces code volume to about 16k from a previous > near 1M, and reduces runtime by a factor of about 2700, as compared to > just -O3. > > Further improvements welcome. > > I'd also suggest adding a section to the GCC documentation on "how to > use GCC as a back-end to another compiler" which gives some typical > magic options like the above that would be useful in circumstances > like these. http://gcc.gnu.org/wiki Enjoy... Andrew.