[patch,libfortran] PR37472 bad output on default-format write of double

Jerry DeLisle jvdelisle@verizon.net
Mon Dec 22 16:41:00 GMT 2008


Hi all,

With Steve Kargl's help, the following simple patch was found to eliminate this 
output problem on x86-64.  I plan to commit under simple and makes sense to do rule.

Regression tested at both -m32 and -m64.

NIST tested with a minor adjustment to FM907 reference output due to the fixed 
decimal point alignment. (FM907 is checked by inspection)

I will come up with a suitable test case.

Regards,

Jerry

Index: write_float.def
===================================================================
--- write_float.def	(revision 142883)
+++ write_float.def	(working copy)
@@ -640,8 +640,8 @@ output_float_FMT_G_ ## x (st_parameter_d
        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)\
          { \



More information about the Gcc-patches mailing list