[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #7 from davidgkinniburgh at yahoo dot co dot uk 2009-03-09 11:33 --- Thanks Jerry. PS CHARACTER(80) :: str no longer needed in test case. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #8 from davidgkinniburgh at yahoo dot co dot uk 2009-03-09 11:34 --- Thanks Jerry. PS CHARACTER(80) :: str no longer required in test case. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #1 from jvdelisle at gcc dot gnu dot org 2009-03-09 02:21 --- I am looking into this. -- jvdelisle at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jvdelisle at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-03-09 02:21:48 date|| Summary|gfortran 20090306: internal |gfortran 20090306: internal |write of 0.0 with F0.3 |write of 0.0 with F0.3 |gives ** |gives ** http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #2 from jvdelisle at gcc dot gnu dot org 2009-03-09 03:17 --- This is a variation of pr37834. My patch for it introduced this bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #3 from jvdelisle at gcc dot gnu dot org 2009-03-09 03:35 --- With the following example: REAL :: x CHARACTER(80) :: str x = 0.0 write (6,'(f0.0)') x write (6,'(f0.1)') x write (6,'(f0.2)') x write (6,'(f0.3)') x write (6,'(f0.4)') x END gfortran gives: $ gfc pr39409.f90 $ ./a.out 0. .0 ** ** ** With this patch: Index: write_float.def === --- write_float.def (revision 144717) +++ write_float.def (working copy) @@ -122,7 +122,7 @@ output_float (st_parameter_dt *dtp, cons /* Handle special cases. */ if (w == 0) - w = 2; + w = d + 2; /* For this one we choose to not output a decimal point. F95 10.5.1.2.1 */ The special case for pr37834 is generalized, giving the following result which matches ifort, sunf95, and Open64 f95. $ ./a.out 0. 0.0 0.00 0.000 0. I plan to commit this patch to trunk under simple and obvious rule if it passes regression testing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #4 from jvdelisle at gcc dot gnu dot org 2009-03-09 04:55 --- Subject: Bug 39402 Author: jvdelisle Date: Mon Mar 9 04:54:50 2009 New Revision: 144719 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144719 Log: 2009-03-08 Jerry DeLisle jvdeli...@gcc.gnu.org PR libfortran/39402 * gfortran.dg/fmt_f0_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/fmt_f0_1.f90 Modified: trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #5 from jvdelisle at gcc dot gnu dot org 2009-03-09 05:00 --- Committed revision 144718. (passed regression testing, had wrong PR number in ChangeLog, fixed) Index: write_float.def === --- write_float.def (revision 144717) +++ write_float.def (working copy) @@ -122,7 +122,7 @@ output_float (st_parameter_dt *dtp, cons /* Handle special cases. */ if (w == 0) - w = 2; + w = d + 2; /* For this one we choose to not output a decimal point. F95 10.5.1.2.1 */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402
[Bug libfortran/39402] gfortran 20090306: internal write of 0.0 with F0.3 gives **
--- Comment #6 from jvdelisle at gcc dot gnu dot org 2009-03-09 05:07 --- David, thanks for the report. Closing. If anyone feels strongly about backporting to 4.3, let me know. -- jvdelisle at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39402