[PLUG] integer-decode-float equivalent in C (gcc bug at -O2 and higher?)

Russell Senior seniorr at aracnet.com
Fri Feb 22 10:54:16 UTC 2008


>>>>> "Fedor" == Fedor Pikus <fpikus at gmail.com> writes:

>> Any clues what I am doing wrong?

Fedor> My guess is that you are doing nothing wrong, but you're seeing
Fedor> differences caused by precision difference of x86
Fedor> floating-point registers and x86 double word (80 bits vs
Fedor> 64). Lisp may do what in GCC is called "float-store" (you can
Fedor> compile with -ffloat-store to test the effect). Or Lisp may
Fedor> change the FPU control to use 64-bit registers, it's a system
Fedor> call, you can do it in your program too: [...]

I have discovered that -fno-strict-aliasing makes the problem go away.
Gdb (when tardily asked) suggested to me the problem was in the cast.
A different value than expected was showing up in the unsigned long
long with -O2.


-- 
Russell Senior         ``I have nine fingers; you have ten.''
seniorr at aracnet.com



More information about the PLUG mailing list