Bug 24819 - [4.1 Regression] glibc math tests miscompiled with gcc-4.1
Summary: [4.1 Regression] glibc math tests miscompiled with gcc-4.1
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2005-11-12 13:35 UTC by olh
Modified: 2005-11-25 19:13 UTC (History)
4 users (show)

See Also:
Host: powerpc-linux
Target: powerpc-linux
Build: powerpc-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
pr24819-failure.txt (732 bytes, text/plain)
2005-11-12 14:07 UTC, olh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description olh 2005-11-12 13:35:36 UTC
make check fails with -O2 on powerpc64-linux and powerpc-linux with gcc-4.1
Works ok with gcc-4.0, and also with 4.1 and -O1.

ppc64:
make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc-nptl/math/test-float.out] Error 1
make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc-nptl/math/test-double.out] Error 1
make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc-nptl/math/test-ifloat.out] Error 1
make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc-nptl/math/test-idouble.out] Error 1
make[1]: *** [math/tests] Error 2

ppc:
make[2]: *** [/usr/src/packages/BUILD/glibc-2.3/cc-nptl/math/test-float.out] Error 1
make[1]: *** [math/tests] Error 2

(make check runs without -k on ppc, the failure rate might be the same as on ppc64).

Will post details and possible a testcase, later.
Comment 1 olh 2005-11-12 14:07:18 UTC
Created attachment 10226 [details]
pr24819-failure.txt

make check errors on powerpc-linux
Comment 2 Andrew Pinski 2005-11-12 15:31:29 UTC
Waiting for a testcase.
Comment 3 Alan Modra 2005-11-16 11:42:36 UTC
I analysed one of these failures quite a while ago.  The conclusion I came to was that the errors were due to excess precision.  gcc-4.1 makes more use of multiply-accumulate instructions.  You could try compiling glibc with -mno-fused-madd.
Comment 4 Alan Modra 2005-11-16 11:44:51 UTC
Marking as invalid given my previous analysis, and that the errors are all 1ulp.
Comment 5 Paolo Bonzini 2005-11-25 19:12:28 UTC
Another failure from glibc's tests is more severe: __DBL_MAX__ * __DBL_MAX__ - __DBL_MAX * __DBL_MAX__ is turned into an INF rather than a NAN (as would happen on most targets) or zero (as would happen on x87 because it computes everything in long double).

This can be seen with a program like

  extern void abort (void)
  {
    double nan = __DBL_MAX__ * __DBL_MAX__ - __DBL_MAX * __DBL_MAX__;
    if (nan == nan && nan != 0.0) abort ();
  }

This seems more serious, to the point that fused multiply-add instructions should be disabled unless !HONOR_NANS || !MODE_HAS_INFINITIES for the given mode.

CCing Eric since he recently had problems with ia64 fma (http://gcc.gnu.org/ml/gcc/2005-10/msg01036.html).
Comment 6 Paolo Bonzini 2005-11-25 19:13:02 UTC
CCing Eric since he recently had problems with ia64 fma
(http://gcc.gnu.org/ml/gcc/2005-10/msg01036.html).