[patch, fortran] PR38285 Wrong I/O output: Interaction between F and P for output

jvdelisle@verizon.net jvdelisle@verizon.net
Thu Dec 4 04:37:00 GMT 2008


Hi all,

I will commit the following patch as obvious and simple with the the 
attached test case.

Regression tested.

Regards,

Jerry

2008-12-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/38285
	* write_float.def (WRITE_FLOAT): Zero for special case only if 
scale_factor = 0.

Index: write_float.def
===================================================================
--- write_float.def	(revision 142425)
+++ write_float.def	(working copy)
@@ -760,7 +760,8 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WI
  	    return;\
  	  }\
  	tmp = sign_bit ? -tmp : tmp;\
-	if (f->u.real.d == 0 && f->format == FMT_F)\
+	if (f->u.real.d == 0 && f->format == FMT_F\
+	    && dtp->u.p.scale_factor == 0)\
  	  {\
  	    if (tmp < 0.5)\
  	      tmp = 0.0;\
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fmt_f_an_p.f
Type: application/octet-stream
Size: 327 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081204/283ed911/attachment.obj>


More information about the Gcc-patches mailing list