From: jvdelisle Date: Sun, 22 Nov 2015 22:14:46 +0000 (+0000) Subject: 2015-11-22 Jerry DeLisle X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3560af84554d1deba4beec8b82a3fa52bd63a86c;p=thirdparty%2Fgcc.git 2015-11-22 Jerry DeLisle * io/write_float.def (output_float): Move block determining room for leading zero to before checkng g0 formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230728 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 77030e9fd4bd..f90d5301df85 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2015-11-22 Jerry DeLisle + + * io/write_float.def (output_float): Move block determining + room for leading zero to before checkng g0 formatting. + 2015-09-12 Francois-Xavier Coudert PR libfortran/67527 diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index dd298aa81ad7..183fe0b9f2ea 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -514,12 +514,21 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, w = w == 1 ? 2 : w; } } - + /* Work out how much padding is needed. */ nblanks = w - (nbefore + nzero + nafter + edigits + 1); if (sign != S_NONE) nblanks--; + /* See if we have space for a zero before the decimal point. */ + if (nbefore == 0 && nblanks > 0) + { + leadzero = 1; + nblanks--; + } + else + leadzero = 0; + if (dtp->u.p.g0_no_blanks) { w -= nblanks; @@ -544,15 +553,6 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size, return false; } - /* See if we have space for a zero before the decimal point. */ - if (nbefore == 0 && nblanks > 0) - { - leadzero = 1; - nblanks--; - } - else - leadzero = 0; - /* For internal character(kind=4) units, we duplicate the code used for regular output slightly modified. This needs to be maintained consistent with the regular code that follows this block. */