From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3976 invoked by alias); 13 Mar 2012 06:34:05 -0000 Received: (qmail 3874 invoked by uid 22791); 13 Mar 2012 06:34:04 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,SUBJ_OBFU_PUNCT_FEW,TW_BJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Mar 2012 06:33:51 +0000 From: "cw at f00f dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/52576] New: fib.c (attached) is slower on current (4.8.0) than 4.6.x Date: Tue, 13 Mar 2012 06:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cw at f00f dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg00948.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52576 Bug #: 52576 Summary: fib.c (attached) is slower on current (4.8.0) than 4.6.x Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: cw@f00f.org The following is found to be slower using gcc 4.8.0 (svn head) compared to gcc 4.6.2 (Debian provided gcc). gcc version 4.6.2 (Debian 4.6.2-12) 0m24.395s gcc version 4.8.0 20120309 (experimental) (GCC) 0m29.159s The results are quite repeatable. The generated code is different (gcc -O3 -c, objdump -d, diff) Built using: gcc -Wall -c -O3 fib.c --------------- #include unsigned int fib(unsigned int n) { if (n < 2) return n; return fib(n-2) + fib(n-1); } int main() { printf("%d\n", fib(48)); return 0; } --------------- (48 was chosen to show the different in performance but also run in a tolerable about of time) Testing various options didn't close the gap, with only a slight improvement from -mtune=opteron with is unexpected as these are Intel Westmere systems.