Date: Sat, 12 Nov 1994 23:07:53 -0500 (CDT) From: Aaron Ucko Subject: Re: DJGPP & MATH To: BILLM AT vaxc DOT cc DOT monash DOT edu DOT au Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Organization: Rockhurst College; Kansas City, MO >Andras Solyom ("solyom AT bmeik DOT eik DOT bme DOT hu") wrote: > >>As I read much about floating point errors in GCC 1.12 or 1.11 nowdays, >>maybe it is worthwile to report about my experinences. >>I was given a C program written by Steven Pemberton (steven.cwi.nl) >>which tests the capabilities of a C compiler. The copy I have is of Ver. 4.2. >>I compiled and run it succesfully with TURBO C and C++ (Version 1.0 -2.0), >>BORLAND C++ (Version 3.0, 3.1 and 4.0) compilers AND with DJGPP 1.09. >>I switched on DJGPP 1.11 maint 5 a while ago and now it occured to me that >>I gave the new compiler a test, and found out that it just crashes as you see: >> > >then Aaron Ucko ("UCKO AT VAX1 DOT ROCKHURST DOT EDU") followed with: > >>Never mind; I ran across the latest version (5.0) and decided to try it >>myself. It also crashes under DJGPP, but at a _much_ more sensible place: >>when trying to divide by 0 (although it should have triggered a trap rather >>than a floating point exception...) What's _really_ interesting is that >> > >Every now and then someone gets one of these test programs, runs it, >and then proclaims that they have discovered a bug in the floating >point code of gcc. Usually (if not always?), the fault is found to >lie in the test program. The code produced by gcc is not perfect but, >as far as I know, it doesn't have any of the obvious bugs which these >programs purport to test for. I'd be about the last person to criticize GCC. What I am criticizing is DJGPP's (mis-)initialization of the FPU (which was mentioned in different guise a little while ago) > >It is quite difficult to make a good floating point test program. The >problem is that there are a lots of possible gotchas allowable in 'C' >when you try to test the margins. Probably the best program which I >have seen is `paranoia' (available on netlib). It doesn't crash, but um...where's netlib? >will report that the floating point has one(*) flaw (paranoia is >wrong). This venerated program is very good but not perfect. > >(*) You may find that it reports more flaws or errors if you use a >floating point emulator other than wmemu1xx. We aren't talking about _emulators_ here (although if they're truly good they'll have the same problem :-) ), but about actual FPUs and DJGPP's misconfiguration thereof. --- Aaron Ucko (ucko AT vax1 DOT rockhurst DOT edu; finger for PGP public key) -=- httyp! -=*=-Just because you're paranoid doesn't mean they aren't out to get you.-=*=- Geek code 2.1 [finger hayden AT vax1 DOT mankato DOT msus DOT edu for explanation]: GCS/M/S d(-) H s g+ p? !au a-- w+ v+ C++(+++)>++++ U-(S+)>++++ P+ L>++ 3(-) E-(----) !N>++ K- W(--) M-(--) V(--) po-(--) Y+(++) t(+) !5 j R G tv--(-) b+++ !D(--) B--(---) e>++++(*) u++(@) h!() f(+) r-(--)>+++ n+(-) y?