This is the mail archive of the glibc-bugs@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]

[Bug math/688] New: Math error on a null sum operation: a =a + 0. !!


Hello,

System configuration: linux Redhat 9.0, pentium4

My software is a scientifical application performing a lot of numerical
operations, usually running on a SUN Solaris 6.2 configuration. I aim to port
the soft on a linux Redhat 9.0 pentium 4.

The application is a mixed software with C et F95 codes, compiled with gcc et
g95 and linked with g95. The compilation options are:
gcc -Wall -O2 -malign-double -march=pentium4
g95 (no option)


I added the following printf in my code ...

.....

double val;

.....

j=(int *) &val;
*(j-1) = 0x01010101;
val = 100.00000005;
printf ("data %x %x %x %x %f\n",*(j-1), *j, *(j+1), j, val);

val = val + 0.;
j=(int *) &val;
printf ("data %x %x %x %x %f\n",*(j-1), *j, *(j+1), j, val);

......

here are the obtained results...
> data 1010101 35afe5 40590000 bfffc550 100.00000005
> data 1010101 0 40590000 bfffc550 100.00000000

The value of val has been changed by the sum of ZERO !!??!!
The addition implies a reset of the upper word of the val value !!

Is this problem due to a bad use of the compilers, bas options, ... is this a
known bug, 

please, help.

-- 
           Summary: Math error on a null sum operation: a =a + 0.    !!
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: critical
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: laurent dot dagnac at atosorigin dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=688

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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