[Bug libfortran/59774] [Regression] Inconsistent rounding between -m32 and -m64
jvdelisle at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Jan 12 01:48:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59774
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Inconsistent rounding |[Regression] Inconsistent
|between -m32 and -m64 |rounding between -m32 and
| |-m64
--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
I think this gets back to:
http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=185433
Using:
print "(ru,g11.2)", 99._8
print "(ru,g11.2)", 99._4
end
Looking at the buffer in output_float we get:
$ gfc -m32 pr59771.f90
$ ./a.out
buffer=+99900000000000000000000e+01<<<
0.99E+02
buffer=+99.000000000000<<<
10.
$ gfc -m64 pr59771.f90
$ ./a.out
buffer=+99900000000000000000000e+01<<<
0.99E+02
buffer=+999000000000000e+01<<<
0.99E+02
Notice the '.' in the buffer for kind=4 vs kind=8
I don't know all the reasons for the changes made, but think "." needs to get
stripped out before we ever get to output_float and the exponent needs to be
there. I do recall the reason gfortran does its own rounding is because the C
implementations across platforms are not consistent.
More information about the Gcc-bugs
mailing list