From: Jerry DeLisle Date: Mon, 22 Dec 2008 14:53:37 +0000 (+0000) Subject: re PR fortran/37472 (bad output on default-format write of double in common block... X-Git-Tag: releases/gcc-4.4.0~1136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82192170e3576ba627a8592079ac0bc4b4d465db;p=thirdparty%2Fgcc.git re PR fortran/37472 (bad output on default-format write of double in common block with -m64) 2008-12-22 Jerry DeLisle PR libfortran/37472 * io/write_float.def (output_float_FMT_G_): Modify calculation of temp to avoid sensitivity to round-off. From-SVN: r142884 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f60c5d0e8def..c04331f60fe1 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2008-12-22 Jerry DeLisle + + PR libfortran/37472 + * io/write_float.def (output_float_FMT_G_): Modify calculation of temp + to avoid sensitivity to round-off. + 2008-12-21 Jerry DeLisle PR libfortran/38398 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index a5d292ca76cd..f94fde30b702 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -640,8 +640,8 @@ output_float_FMT_G_ ## x (st_parameter_dt *dtp, const fnode *f, \ GFC_REAL_ ## x temp;\ mid = (low + high) / 2;\ \ - temp = 0.1 * calculate_exp_ ## x (mid) - 0.5\ - * calculate_exp_ ## x (mid - d - 1);\ + temp = (calculate_exp_ ## x (mid) - \ + 5 * calculate_exp_ ## x (mid - d - 1)) / 10;\ \ if (m < temp)\ { \