This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/8156: -mcpu=pentium4 generates wrong fp results in glibc-2.3
- From: bregor at sf dot anu dot edu dot au
- To: gcc-gnats at gcc dot gnu dot org
- Date: 7 Oct 2002 03:04:04 -0000
- Subject: optimization/8156: -mcpu=pentium4 generates wrong fp results in glibc-2.3
- Reply-to: bregor at sf dot anu dot edu dot au
>Number: 8156
>Category: optimization
>Synopsis: -mcpu=pentium4 generates wrong fp results in glibc-2.3
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sun Oct 06 20:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Roger Brown
>Release: gcc (GCC) 3.2.1 20021004 (prerelease)
>Organization:
>Environment:
Linux-2.4.19-pre10
HJL's binutils-2.13.90.0.4
glibc-2.3 release source code
>Description:
*** This may be a duplicate report but the original seems
to have got lost.
After building the released source for glibc-2.3,
with "gcc (GCC) 3.2.1 20021004 (prerelease)", and the
-mcpu=pentium4 -march=pentium4 switches, make check
discovered many serious errors for the floating-point
special functions (see below). The same build, with
-mcpu=i686 -march=i686 failed with an assembler error.
With -mcpu and -march left at the default values, both
the build and check are clean.
Other software details: O/S linux-2.4.19-pre10 and
HJL's Linux-binutils-2.13.90.0.4.
The actual "check" failure was:
GCONV PATH=/Main/Glibc/glibc-2.3/Build/iconvdata LC ALL=C
/Main/Glibc/glibc-2.3/Build/elf/ld-linux.so.2 --library-path
/Main/Glibc/glibc-2.3/Build:/Main/Glibc/glibc-2.3/Build/math:
/Main/Glibc/glibc-2.3/Build/elf:/Main/Glibc/glibc-2.3/Build/dlfcn:
/Main/Glibc/glibc-2.3/Build/nss:/Main/Glibc/glibc-2.3/Build/nis:
/Main/Glibc/glibc-2.3/Build/rt:/Main/Glibc/glibc-2.3/Build/resolv:
/Main/Glibc/glibc-2.3/Build/crypt:/Main/Glibc/glibc-2.3/Build/linuxthreads
/Main/Glibc/glibc-2.3/Build/math/test-idouble >
/Main/Glibc/glibc-2.3/Build/math/test-idouble.out
make[2]: *** [/Main/Glibc/glibc-2.3/Build/math/test-idouble.out] Error 139
The errors reported in test-idouble.out are alarming !
The first part reads:
testing double (without inline functions)
Failure: Test: cosh (0.75) == 1.29468328467684468784170818539018176
Result:
is: 2.11700001661267478426e+00 0x1.0ef9db467dcf80000000p+1
should be: 1.29468328467684479222e+00 0x1.4b705d1e5d6a80000000p+0
difference: 8.22316731935829992040e-01 0x1.a506b2dd3c6900000000p-1
ulp : 3703385327526728.0000
max.ulp : 0.0000
Maximal error of `cosh'
is : 3703385327526728 ulp
accepted: 0 ulp
Failure: sinh (-inf) == -inf: Exception "Invalid operation" set
Failure: Test: sinh (-inf) == -inf
Result:
is: nan nan
should be: -inf -inf
Failure: Test: sinh (0.75) == 0.822316731935829980703661634446913849
and it gets much worse, much worse !!
Specific *.i files etc can be provided.
>How-To-Repeat:
Build glibc-2.3 with -mcpu=pentium4 -march=pentium4
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: