On 12/26/2010 8:40 PM, Igor Stasenko wrote:
Note, that on unix and mac it defines -DNO_ISNAN while on win32, it compiles with -O0 flag, which turns off all optimizations.
It would be good to know why optimization(s) causing crash, and how we could fix that in code, because i'm not in favor having VM which stability depends on compiler peculiarities.
Because fdlibm aliases integer pointers with floating point values. Compilers generally don't assume that, i.e.,
double foo = 1.0; #ifdef BIGENDIAN unsigned int *highWord = (unsigned int*)&foo; #else unsigned int *highWord = ((unsigned int*)&foo)++; #endif *highWord |= 0x8000000;
might change the sign of foo and that it would invalidate a prior value in an fpu register. But fdlibm does this kind of stuff *all the time*.
Cheers, - andreas