[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#210598: libc6.1: Operations on subnormal floating-point numbers generate a floating point exception



On Sat, Sep 13, 2003 at 12:08:06AM +0200, Vincent Lefevre wrote:
> On 2003-09-12 14:39:40 -0400, Daniel Jacobowitz wrote:
> > That's life on Alpha.  I believe you can get different behavior by
> > compiling with -mieee, does that work?
> 
> That works, but IEEE-754 isn't the only standard. The ISO C standard
> has its own requirements. In my case, there was neither an erroneous
> arithmetic operation, nor a range error; therefore I shouldn't have
> got a FPE signal.
> 
> (Note: I compiled with -std=c99.)

While the documentation is not explicit about this, it does say:
`-mieee'
     The Alpha architecture implements floating-point hardware
     optimized for maximum performance.  It is mostly compliant with
     the IEEE floating point standard.  However, for full compliance,
     software assistance is required.  This option generates code fully
     IEEE compliant code _except_ that the INEXACT-FLAG is not
     maintained (see below).  If this option is turned on, the
     preprocessor macro `_IEEE_FP' is defined during compilation.  The
     resulting code is less efficient but is able to correctly support
     denormalized numbers and exceptional IEEE values such as
     not-a-number and plus/minus infinity.  Other Alpha compilers call
     this option `-ieee_with_no_inexact'.

I.E. without -mieee denormalized numbers are not completely supported.

There's no way to fix this without using -mieee, and for some reason I
can't remember at the moment the GCC maintainers do not want that to be
the default.  If you care about compliance of FP code, use -mieee.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: