http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48906
--- Comment #24 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-06-06 08:38:13 UTC --- (In reply to comment #23) > Patch submitted to list for approval. For a scale factor 0, we are done. Good work, thank you! A scale factor != 0 does not work yet, you wrote you are still working on it, is that correct? print "(-2pg12.3)", 0.02 ! 0.200E-01 expected 0.002E+01 print "(-1pg12.3)", 0.02 ! 0.200E-01 expected 0.020E+00 print "(0pg12.3)", 0.02 ! 0.200E-01 print "(1pg12.3)", 0.02 ! 0.200E-01 expected 2.000E-02 print "(2pg12.3)", 0.02 ! 0.200E-01 expected 20.00E-03 --- gcc/testsuite/gfortran.dg/pr20755.f (revision 174320) +++ gcc/testsuite/gfortran.dg/pr20755.f (working copy) @@ -5,8 +5,8 @@ character*30 s write (s,2000) 0.0, 0.02 - if (s .ne. " 0.00 2.000E-02") call abort + if (s .ne. " 0.00 0.200E-01") call abort write (s,2000) 0.01, 0.02 - if (s .ne. " 1.000E-02 2.000E-02") call abort + if (s .ne. " 0.100E-01 0.200E-01") call abort 2000 format (1PG12.3,G12.3) end I don't agree with the changes to this testcase, since the scale factor does not work yet, and the test was correct before. --- gcc/testsuite/gfortran.dg/fmt_g0_6.f08 (revision 174320) +++ gcc/testsuite/gfortran.dg/fmt_g0_6.f08 (working copy) @@ -57,7 +57,7 @@ contains do dec = d, 0, -1 lower = 10.0_RT ** (d - 1 - dec) - r * 10.0_RT ** (- dec - 1) upper = 10.0_RT ** (d - dec) - r * 10.0_RT ** (- dec) - if (lower <= mag .and. mag < upper) then + if (lower < mag .and. mag <= upper) then write(fmt_f, "('R', a, ',F', i0, '.', i0, ',', i0, 'X')") roundmode, w - n, dec, n exit end if I don't agree with this change, since it was according to the Fortran standard before (it does not actually make a difference for the values we currently check in this test, though.)