This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libfortran] PR37863 [4.3/4.4 Regression] Display of a value close but less to 1 shows 2 with '(F3.0)'
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 17 Oct 2008 22:21:59 -0700
- Subject: [patch, libfortran] PR37863 [4.3/4.4 Regression] Display of a value close but less to 1 shows 2 with '(F3.0)'
Hi,
I will commit the following patch as obvious. The patch to io.h is unrelated to
this bug, but is a code cleanup.
Regression tested on x86-64-linux-gnu.
2008-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37707
* io/write_float.def (WRITE_FLOAT): Round to 1.0 correctly.
* io/io.h (st_parameter_44): Fix id type declaration.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 141206)
+++ ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org
+
+ PR libfortran/37707
+ * io/write_float.def (WRITE_FLOAT): Round to 1.0 correctly.
+
2008-10-16 Thomas Koenig <tkoenig@gcc.gnu.org>
* io/file_pos.c (unformatted_backspace): Normal case is
Index: io/io.h
===================================================================
--- io/io.h (revision 141206)
+++ io/io.h (working copy)
@@ -458,7 +458,7 @@ typedef struct st_parameter_43
typedef struct st_parameter_44
{
- GFC_IO_INT *id;
+ GFC_INTEGER_4 *id;
GFC_IO_INT pos;
CHARACTER1 (asynchronous);
CHARACTER2 (blank);
Index: io/write_float.def
===================================================================
--- io/write_float.def (revision 141206)
+++ io/write_float.def (working copy)
@@ -746,7 +746,7 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WI
if (tmp < 0.5)\
tmp = 0.0;\
else if (tmp < 1.0)\
- tmp = tmp + 0.5;\
+ tmp = 1.0;\
}\
zero_flag = (tmp == 0.0);\
\