Here's a simple test case: #include <stdio.h> #include <math.h> int main(int argc, char *argv[]) { double x = 17.12385, ix, rx; rx = modf(x,&ix); printf("modf(%lf): ix=%lf, rx=%lf\n",x,ix,rx); return 0; } On my PPC, Athlon-XP, Athlon, and 3s, i get the expected: modf(17.123850): ix=17.000000, rx=0.123850 On the P4 bootstrapped with CLAGS="-march=pentium4 -O3 -pipe", i get: modf(17.123850): ix=-0.000000, rx=17.123850 which causes all sorts of fun whenever that call is used. Per drobbins suggestion, I am rebuilding glibc with the following cmd: CFLAGS="-march=686 -O3 -pipe" emerge glibc If this does not fix the problem, I will report back here. :)
missing details: glibc-2.3.1-r2, gcc-3.2.1-r6, binutils-2.13.90.0.16-r1 rebuiding with -march=i686 fixes the problem
Known issue. -march=pentium3 works as well ...
is there a URL we can refer to ?
Personal testing. I guess I could replace-flags "pentium4" "pentium3" ?
does the glibc ebuild come with a built in test for this ? if not, a simple program would not be hard to develop ... (we got one already) that way the concern that the flag replacement may be forgotten when gcc is fixed will be taken care of ...
True. Currently a -march=pentium3 -O2 -pipe compiled glibc-2.3.1 just fail over here during 'make check' on the atime test, but that is expected. If you can develop a test that catches all of these sure, but I can only see that we will have to keep on testing with new gcc releases ....
Tried with gcc-3.2.2 snapshot, but its still not fixed.
okay, latest information: glibc-2.3.2 is still broken with -march=pentium4, gcc-3.2.2
*** Bug 18284 has been marked as a duplicate of this bug. ***
Another way to avoid this rather than changing to '-march=pentium3' or '-march=i686' is to add the '-mno-sse2' flag. However you'll also have to add it to the list of allowed flags in '/usr/portage/eclass/flag-o-matic.eclass' since glibc uses the strip-flags function. And the changes you make to the flag-o-matic eclass gets reset every time you do an 'emerge sync'. =/
another update ... gcc-3.2.3 fixes this bug