diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-28 18:33:20 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2019-11-28 18:33:20 +0000 |
commit | 68c28e37e494a639dd6f7e7d21c79af7f8b71d17 (patch) | |
tree | 884fa1d2b27e695975cafb49ab647aacd5f22ba5 /gcc | |
parent | 9c28689a9908c56fffcf7b1acd6dec3fb8a947e2 (diff) | |
download | gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.zip gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.tar.gz gcc-68c28e37e494a639dd6f7e7d21c79af7f8b71d17.tar.bz2 |
re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)
PR fortran/90374
* io.c (check_format): Allow zero width expoenent with e0.
* io/format.c (parse_format_list): Relax format checking to allow
e0 exponent specifier.
* gfortran.dg/fmt_zero_width.f90: Update test.
From-SVN: r278817
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/io.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/fmt_zero_width.f90 | 20 |
4 files changed, 38 insertions, 11 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4cf6e9e..b267386 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2019-11-28 Jerry DeLisle <jvdelisle@gcc.ngu.org> + + PR fortran/90374 + * io.c (check_format): Allow zero width expoenent with e0. + 2019-11-27 Jakub Jelinek <jakub@redhat.com> PR fortran/91944 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 57a3fdd..8cf8c2d 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -1007,9 +1007,22 @@ data_desc: goto fail; if (u != FMT_POSINT) { - error = G_("Positive exponent width required in format string " - "at %L"); - goto syntax; + if (u == FMT_ZERO) + { + if (!gfc_notify_std (GFC_STD_F2018, + "Positive exponent width required in " + "format string at %L", &format_locus)) + { + saved_token = u; + goto fail; + } + } + else + { + error = G_("Positive exponent width required in format " + "string at %L"); + goto syntax; + } } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eeb4379..65e7ffc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-28 Jerry DeLisle <jvdelisle@gcc.ngu.org> + + PR fortran/90374 + * gfortran.dg/fmt_zero_width.f90: Update test. + 2019-11-28 Martin Jambor <mjambor@suse.cz> PR ipa/92697 diff --git a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 index 093c0a4..640b673 100644 --- a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 +++ b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 @@ -1,11 +1,11 @@ ! { dg-do run } ! PR90374 "5.5 d0.d, e0.d, es0.d, en0.d, g0.d and ew.d edit descriptors program pr90374 + implicit none real(4) :: rn character(32) :: afmt, aresult - real(8) :: one = 1.0D0, zero = 0.0D0, nan, pinf, minf + real(8) :: one = 1.0D0, zero = 0.0D0, pinf, minf - nan = zero/zero rn = 0.00314_4 afmt = "(D0.3)" write (aresult,fmt=afmt) rn @@ -22,15 +22,19 @@ program pr90374 afmt = "(G0.10)" write (aresult,fmt=afmt) rn if (aresult /= "0.3139999928E-02") stop 24 + afmt = "(E0.10e0)" + write (aresult,fmt=afmt) rn + if (aresult /= "0.3139999928E-02") stop 27 write (aresult,fmt="(D0.3)") rn - if (aresult /= "0.314D-02") stop 26 + if (aresult /= "0.314D-02") stop 29 write (aresult,fmt="(E0.10)") rn - if (aresult /= "0.3139999928E-02") stop 28 + if (aresult /= "0.3139999928E-02") stop 31 write (aresult,fmt="(ES0.10)") rn - if (aresult /= "3.1399999280E-03") stop 30 + if (aresult /= "3.1399999280E-03") stop 33 write (aresult,fmt="(EN0.10)") rn - if (aresult /= "3.1399999280E-03") stop 32 + if (aresult /= "3.1399999280E-03") stop 35 write (aresult,fmt="(G0.10)") rn - if (aresult /= "0.3139999928E-02") stop 34 - + if (aresult /= "0.3139999928E-02") stop 37 + write (aresult,fmt="(E0.10e0)") rn + if (aresult /= "0.3139999928E-02") stop 39 end |