Re: -O2 faster than -O3

2015-04-02 Thread Jim Wilson
On Thu, Apr 2, 2015 at 3:19 AM, Edward Nevill wrote: > Looking at the disassembly I see it is using FP registers to hold > integer values. The following is a small extract. -O3 turns on -finline-functions, which causes a lot of code expansion. That, combined with the fact that we end up with a ca

-O2 faster than -O3

2015-04-02 Thread Edward Nevill
Hi, I did some tests on the following function --- CUT HERE --- int fibo(int n) { if (n < 2) return 1; return (fibo(n-2) + fibo(n-1)); } --- CUT HERE --- and I discovered that it is faster -O2 than -O3. This is with gcc 4.9.2. Looking at the disassembly I see it is using FP registers to hol