https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90374

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Author: jvdelisle
Date: Thu Nov  7 03:06:20 2019
New Revision: 277905

URL: https://gcc.gnu.org/viewcvs?rev=277905&root=gcc&view=rev
Log:
2019-11-06  Jerry DeLisle  <jvdeli...@gcc.ngu.org>

        PR fortran/90374
        * io.c (check_format): Allow zero width for D, E, EN, and ES
        specifiers as default and when -std=F2018 is given. Retain
        existing errors when using the -fdec family of flags.

        * libgfortran/io/format.c (parse_format_list): Relax format checking
for
        zero width as default and when -std=f2018.
        io/format.h (format_token): Move definition to io.h.
        io/io.h (format_token): Add definition here to allow access to
        this definition at higher levels. Rename the declaration of
        write_real_g0 to write_real_w0 and add a new format_token
        argument, allowing higher level functions to pass in the
        token for handling of g0 vs the other zero width specifiers.
        io/transfer.c (formatted_transfer_scalar_write): Add checks for
        zero width and call write_real_w0 to handle it.
        io/write.c (write_real_g0): Remove.
        (write_real_w0): Add new, same as previous write_real_g0 except
        check format token to handle the g0 case.

        * gfortran.dg/fmt_error_10.f: Modify for new constraints.
        * gfortran.dg/fmt_error_7.f: Add dg-options "-std=f95".
        * gfortran.dg/fmt_error_9.f: Modify for new constraints.
        * gfortran.dg/fmt_zero_width.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/fmt_zero_width.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/io.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/fmt_error_10.f
    trunk/gcc/testsuite/gfortran.dg/fmt_error_7.f
    trunk/gcc/testsuite/gfortran.dg/fmt_error_9.f
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/format.c
    trunk/libgfortran/io/format.h
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/write.c

Reply via email to