aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-22 22:14:46 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-22 22:14:46 +0000
commit3560af84554d1deba4beec8b82a3fa52bd63a86c (patch)
treedf72fb6bf3a8ab04fdf995c8bf53b8765f1f94f2 /libgfortran
parentf7e68284b737222c5f34cd4aa40f31c4bd0f1263 (diff)
2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* 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
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/write_float.def20
2 files changed, 15 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 77030e9fd4b..f90d5301df8 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * io/write_float.def (output_float): Move block determining
+ room for leading zero to before checkng g0 formatting.
+
2015-09-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/67527
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index dd298aa81ad..183fe0b9f2e 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. */