This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug with g77 and -mieee on Alpha Linux


Richard Henderson wrote:
> 
> Underflow to zero always ocurrs when software completion (ie -mieee)
> is not requested.  This is still useful for when you need -mieee to
> handle Inf and NaN, but don't care about denormals.

The problem I ran into immediately (with C++) was a call to a math
function (e.g., exp()) that returns a denormal.  libm must have been
compiled with -mieee, or its equivalent.  When my code is compiled the
default way, without -mieee, the denormal eventually causes a
floating-point exception that crashes my program.  Yes, it forced me to
discover and start using -mieee, but the default compilation linked with
the standard libm does not execute gracefully.

Contributors to this list like to blame the programmer for incorrect
code.  I think someone should reconsider the interaction between the
compiled code and the libm functions.  If that means that functions like
exp() should return 0 instead of denormals, it's fine with me.  If
setting a hardware register to force denormals to 0 will have the same
effect, that's also fine.  

Just provide a reasonable way to use the compiler and the math functions
in a reliable way.  At the moment, that's not the default.

-- 
Dick Hadsell			914-381-8400 x5446 Fax: 914-381-9790
Reply-to:			hadsell@blueskystudios.com
Blue Sky Studios                http://www.blueskystudios.com
1 South Road, Harrison, NY 10528


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]