[Vm-dev] FloatMathPlugin crashes the VM if compiled with gcc
siguctua at gmail.com
Sun Dec 26 21:19:32 UTC 2010
On 26 December 2010 21:57, Andreas Raab <andreas.raab at gmx.de> wrote:
> 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
>> 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;
> unsigned int *highWord = ((unsigned int*)&foo)++;
> *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*.
low level C code which pretending to know how to do it 'right' +
C compiler , who also knowing how to do it 'right' ===>> mess in result :)
> - andreas
Igor Stasenko AKA sig.
More information about the Vm-dev