[Shootout-list] Problems building GCC C Fibonacci.

Dave davejf@frontiernet.net
Sun, 20 Mar 2005 16:58:38 -0600


The GCC C build for the new Fibonacci reports errors, yet still shows that 
the test ran.

http://shootout.alioth.debian.org/great/benchmark.php?test=fibo&lang=gcc&sort=fullcpu

I've duplicated the compilation errors with GCC v3.4.2 on my system using 
the same switches, etc. and (as expected) there is not an executable built. 
The offending line of code is:

unsigned long fib(unsigned long n) __attribute__ ((regparm(3)));

Since the program output for N = 32 is for the old version, it looks like 
the older executable is being ran.

It compiles fine with Intel C v8.1, which I presume is what the contributor 
was targeting. Or perhaps it compiles fine with an older version of GCC.

BTW - Wouldn't this constitute a "cheat" because __attribute__ is not part 
of the C language, but is source code that is implementation specific?

Thanks,

- Dave