Might not be a bug even, but I haven't had much luck in finding a definitive
answer. I get different output depending on whether I compile the following
testcase as 32-bit vs 64-bit on linux-ppc64 (gcc-3.4 and gcc-4).
int x=1023, y=1023;
z = (double)(x-y);
printf ("z = %e\n", z);
If I compile this as '-O0 -m32' I get a result of:
z = -0.000000e+00
But compiling for 64-bit, '-O0 -m64' I get result of:
z = 0.000000e+00
This was noticed by someone testing linux-ppc glibc::logb(1) after having set
the rounding mode to FE_DOWNWARD and getting a -0.0 result (glibc has similar
code as testcase above).
GCC bug vs GLIBC bug vs User Error?
-m64 makes use of fcfid while 32bit PPC uses the following construct:
so there is subtraction which causes the difference.
But I don't know if this is gcc problem or just an user not expecting -0.
this is incorrect