http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60128
--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
While the patch in comment 4 fixed they PR, it was quite hawkish and did not
explained the problem. After a deeper analysis it turns out that it is yet
another "off by one bug" fixed by the following one liner:
--- ../_clean/libgfortran/io/write_float.def 2014-01-21 08:30:57.000000000
+0100
+++ libgfortran/io/write_float.def 2014-02-16 20:56:56.000000000 +0100
@@ -1204,7 +1200,7 @@ determine_en_precision (st_parameter_dt
if (nprinted == -1)
return -1;
- int e = atoi (&buffer[5]);
+ int e = atoi (&buffer[4]);
int nbefore; /* digits before decimal point - 1. */
if (e >= 0)
nbefore = e % 3;
as &buffer[5] does not include the sign of the exponent.