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: unassig...@gcc.gnu.org ReportedBy: c...@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 <stdio.h> 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.