This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

y0/y1/yn and exceptions - GCC 3.4 changes


Compiling glibc with current GCC 3.4 gives the following errors in the
testsuite:

For float:
testing float (without inline functions)
Failure: y0 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y0 (0.0) == -inf: Exception "Divide by zero" set
Failure: y1 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y1 (0.0) == -inf: Exception "Divide by zero" set
Failure: yn (0, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (0, 0.0) == -inf: Exception "Divide by zero" set
Failure: yn (1, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (1, 0.0) == -inf: Exception "Divide by zero" set

For double:
testing double (without inline functions)
Failure: y0 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y0 (0.0) == -inf: Exception "Divide by zero" set
Failure: y1 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y1 (0.0) == -inf: Exception "Divide by zero" set
Failure: yn (0, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (0, 0.0) == -inf: Exception "Divide by zero" set
Failure: yn (1, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (1, 0.0) == -inf: Exception "Divide by zero" set

For long double:
testing long double (without inline functions)
Failure: y0 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y0 (0.0) == -inf: Exception "Divide by zero" set
Failure: y0 (NaN) == NaN: Exception "Invalid operation" set
Failure: y1 (-1.0) == -inf: Exception "Invalid operation" set
Failure: y1 (0.0) == -inf: Exception "Divide by zero" set
Failure: y1 (NaN) == NaN: Exception "Invalid operation" set
Failure: yn (0, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (0, 0.0) == -inf: Exception "Divide by zero" set
Failure: yn (1, -1.0) == -inf: Exception "Invalid operation" set
Failure: yn (1, 0.0) == -inf: Exception "Divide by zero" set

Note that these failures occur on x86, x86-64 and ia64!

I analyzed the y0 (0.0) failure for double:  

In e_j0.c we check for y0(0.0) with:
        if((ix|lx)==0) return -one/zero;

Previously GCC evaluated this at compiletime and generated a NaN but
since this was done at compile-time, no exception was set at run-time

Now GCC does the calculation at run-time and sets the exception
(Roger, is this correct?  I remember you doing work in this area).

I think the latter case is correct and therefore the GCC testsuite is
wrong to not allow those exceptions to be set.  I propose to change
the testsuite to allow these exceptions be set - but not mandate them
so that the testsuite passes with older compilers.

What do you think?  Is GCC correct and we should change glibc?  In
that case I'll make the changes to the math testsuite.

The only strange thing is that only for long double the "Invalid
operation" exception is raised in this case:
Failure: y0 (NaN) == NaN: Exception "Invalid operation" set

Btw. on x86-64 (I haven't checked the other archs yet) this is the
only failure I see compiling glibc with GCC 3.4 when running the
testsuite.

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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