Strange optimisation problem - gcc 4.3.2

Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Thu Nov 12 13:27:00 GMT 2009


Andrew Haley wrote:

> Within reason that's OK, or you can use pastebin.

Done. Patch attached. All you need to do to build is the following:

svn co svn://openbios.org/openbios/trunk/openbios-devel
cd openbios-devel
patch -p0 < openbios-fibonacci.patch

Then to build on x86:
rm -rf obj-x86/; ./config/scripts/switch-arch x86; make

To run the benchmark:
time echo "28 fib-rec u. bye" | ./obj-x86/openbios-unix 
./obj-x86/openbios-x86.dict

Uncomment the function pointer at the top of kernel/internal.c then 
rebuild and rerun the benchmark. I see the time change from 37s to 52s 
on my laptop here.

Interestingly enough, I just did an "svn up" which pulled in some more 
changes before submitting the patch, and now I see that the position is 
reversed!? So without the function pointer things run slow, but with it 
things run fast again. I think you may be thinking along the right lines 
in that it's related to alignment of something changing.

> It is possible to run this test on a Linux system, isn't it?

Yes - I use x86_64 Linux as my main work environment.


Many thanks,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbios-fibonacci.patch
Type: text/x-diff
Size: 1217 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20091112/18342324/attachment.bin>


More information about the Gcc mailing list