fortran/89100: Default widths with -fdec-format-defaults
authorJanne Blomqvist <jb@gcc.gnu.org>
Wed, 22 May 2019 11:56:01 +0000 (14:56 +0300)
committerJanne Blomqvist <jb@gcc.gnu.org>
Wed, 22 May 2019 11:56:01 +0000 (14:56 +0300)
commit88a8126a906f32068724d87416eeb01971f37f35
treeab7979c83f78bf0bfec681cc5ace497f74f98998
parentfa70c22141f5075ad4a9a3a6630f083c92755799
fortran/89100: Default widths with -fdec-format-defaults

gcc/fortran ChangeLog:

2019-05-22  Jeff Law  <law@redhat.com>
            Mark Eggleston  <mark.eggleston@codethink.com>

        PR fortran/89100
        * gfortran.texi: Add Default widths for F, G and I format
        descriptors to Extensions section.
        * invoke.texi: Add -fdec-format-defaults
        * io.c (check_format): Use default widths for i, f and g when
        flag_dec_format_defaults is enabled.
        * lang.opt: Add new option.
        * options.c (set_dec_flags): Add SET_BITFLAG for
        flag_dec_format_defaults.

gcc/testsuite ChangeLog:

2019-05-22  Mark Eggleston  <mark.eggleston@codethink.com>

        PR fortran/89100
        * gfortran.dg/fmt_f_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_f_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_f_default_field_width_3.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_g_default_field_width_3.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_1.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_2.f90: New test.
        * gfortran.dg/fmt_i_default_field_width_3.f90: New test.

libgfortran ChangeLog:

2019-05-22  Jeff Law  <law@redhat.com>

        PR fortran/89100
        * io/format.c (parse_format_list): set default width when the
        IOPARM_DT_DEC_EXT flag is set for i, f and g.
        * io/io.h: add default_width_for_integer, default_width_for_float
        and default_precision_for_float.
        * io/write.c (write_boz): extra parameter giving length of data
        corresponding to the type's kind.
        (write_b): pass data length as extra parameter in calls to
        write_boz.
        (write_o): pass data length as extra parameter in calls to
        write_boz.
        (write_z): pass data length as extra parameter in calls to
        write_boz.
        (size_from_kind): also set size is default width is set.
        * io/write_float.def (build_float_string): new paramter inserted
        before result parameter. If default width use values passed
        instead of the values in fnode.
        (FORMAT_FLOAT): macro modified to check for default width and
        calls to build_float_string to pass in default width.
        (get_float_string): set width and precision to defaults when
        needed.

From-SVN: r271511
22 files changed:
gcc/fortran/ChangeLog
gcc/fortran/gfortran.texi
gcc/fortran/invoke.texi
gcc/fortran/io.c
gcc/fortran/lang.opt
gcc/fortran/options.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/fmt_f_default_field_width_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_f_default_field_width_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_f_default_field_width_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_g_default_field_width_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_g_default_field_width_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_g_default_field_width_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_i_default_field_width_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_i_default_field_width_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/fmt_i_default_field_width_3.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/format.c
libgfortran/io/io.h
libgfortran/io/read.c
libgfortran/io/write.c
libgfortran/io/write_float.def