This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] PATCH write with unspecified width for real output (PRlibfortran/18025)


This submitted patch fixes PR libfortran/18025. This is a regression WRT g77 but is not a bug standardwise.

*strapped and regtested on i686-linux. OK for mainline and 4.0?


2005-02-27 FranÃois-Xavier Coudert <coudert@clipper.ens.fr>


	PR libfortran/20101
	* write.c (output_float): Make handling of the "F0.d" format
	  similarly as commercial compilers.
Index: write.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/write.c,v
retrieving revision 1.23
diff -p -u -r1.23 write.c
--- write.c     21 Feb 2005 19:59:58 -0000      1.23
+++ write.c     27 Feb 2005 17:14:02 -0000
@@ -518,7 +534,7 @@ output_float (fnode *f, double value, in
 
   /* Pick a field size if none was specified.  */
   if (w <= 0)
-    w = nbefore + nzero + nafter + 2;
+    w = nbefore + nzero + nafter + (sign != SIGN_NONE ? 2 : 1);
 
   /* Create the ouput buffer.  */
   out = write_block (w);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]