[Discuss] Test for positive gives wacko results for underflowed values for the gcc compiler suite (including the gcc compiler, and g77 and gfortran compilers)

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Jun 25 15:58:50 PDT 2007


On 2007-06-25 14:50-0700 pw wrote:

> Alan W. Irwin wrote:
>> 
>> 
>> Python gives the correct results both on my Ubuntu system
>> (Python 2.4.3) and my older Debian system (Python 2.3.5).
>
>
> What compile flags for python vs. gfortran?

Don't know.

> Is it compiled with gcc to use a floating point
> library rather than the floating point processor?

I am not quite sure what you are referring to here.  Is it the kernel option
for using software floating-point emulation versus using the floating-point
processor of the cpu?  My systems use just the default (which I am sure is
to do floating-point calculations in hardware since that should be much
faster than emulating them).

>
> The difference has to be in the compilation of
> the interpreter binary.

I assume both python and gcc use the C library and the math library so I
suspect the issue is not in those libraries and instead is caused by some
mishandling of underflows internally in gcc/g77/gfortran.

Test results for non-gcc compilers would help to sort out whether this
suspicion of a bug in gcc and friends is correct or not.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the Discuss mailing list