Date: Mon, 5 May 1997 15:44:49 +0200 From: griepent@wias-berlin.de To: bugs@FreeBSD.org Subject: Underflow floating point exceptions under FreeBSD 2.1.5 Message-ID: <9705051344.AA16083@pascal.wias-berlin.de>
next in thread | raw e-mail | index | archive | help
Hello, FreeBSD experts! I am going to use numerical applications on a X11 Window desktop and I want to work with the nice and stable FreeBSD system at home. To stay compatible with an institute I want to use a numerical package written in ANSI-C which works flawlessly on DEC and SGI machines. I was able to compile (gcc-2.6.3) the package on several Intel platforms (from 486 DX to PentiumPro) under FreeBSD-2.1.5. Trying to run it there always occured strange underflow floating point exceptions in code fragments computing mathematical functions like sqrt, cos, log with harmless arguments of type double in the range of 1.0e-20 to 1.0e+20, which should be normally no big deal in the IEEE 754 world! My first idea was to recompile the code with gnu debugger support enabled and no optimization options. So I have got the same underflow floating point exceptions, but now more localized, namely in the above mathematical functions contained in the shared library /usr/lib/libm.so My next idea was a little bit more successful: recompiling the libm sources with gdb support enabled. Building the numerical package with that new math library and setting appropriate breakpoints in the sqrt, log and cos function calls of the library I was able to localize the underflows in the loops which iteratively compute the values of that functions. Remembering a similar looping problem (many years ago on other platforms) I have decided to recompile the libm sources with no optimization! Again building the package with that math library the code is running now and we get the same numerical results and performance as on the DEC or SGI machines! Now my questions: (1) Let me assume that the original libm shared library was compiled also with the gcc-2.6.3 compiler. Is there a (known) optimization bug in the gcc-2.6.3 compiler? (2) What about the other system libraries? Perhaps I have to be aware to run in trouble in a similar manner! (3) Is there any hope to get rid of that problems in one of the next versions of FreeBSD or newer gcc versions? It was the first serious disappointment in my two year experience with that system. Please, let me stay trusting the FreeBSD operating system, I want miss it for such a reason! It would be very nice, if you could give me a hint! Jens Griepentrog griepent@wias-berlin.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9705051344.AA16083>