[Vm-dev] FloatMathPlugin crashes the VM if compiled with gcc optimization

Igor Stasenko siguctua at gmail.com
Sun Dec 26 22:37:37 UTC 2010


On 26 December 2010 22:52, Andreas Raab <andreas.raab at gmx.de> wrote:
>
> On 12/26/2010 10:24 PM, Igor Stasenko wrote:
>>
>> btw, how old that fdlibm portions there?
>> maybe updating it will be a simple solution to that issue?
>
> I've never found any newer release than here:
>
> http://www.netlib.org/fdlibm/
>

oh , yeah..
http://www.netlib.org/fdlibm/readme
actually says about that:

NOT FIXED YET

    3. Compiler failure on non-standard code
	Statements like
	            *(1+(int*)&t1) = 0;
	are not standard C and cause some optimizing compilers (e.g. GCC)
	to generate bad code under optimization.    These cases
	are to be addressed in the next release.

>> Oh, and please, can you shed some light on the history, why for
>> floating-point
>> math in Squeak, VM using non-standard math lib, which comes with any C
>> compiler, but instead, a  portions of separate 3rd party library?
>
> You would be surprised to find out just how much the results of the C
> compiler libraries differ when it comes to edge cases. I've run the
> experiment in the past:
>
> Using Python 2.4:
>>>> import math
>>>> math.cos(1.0e32)
>
> WinXP:    -0.39929634612021897
> LinuxX86: -0.49093671143542561
>
> In short, the results *dramatically* vary depending on processor family,
> processor version, C compiler libraries, and so on. None of the libraries
> produce cross-platform bit-identical results. fdlibm does.
>

i see. And it looks like this library used by java vm. It is very
strange that Oracle having no interest in maintaining it anymore:

http://mailman.oakapple.net/pipermail/numeric-interest/2010-September/002054.html



> Cheers,
>  - Andreas
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list