[Patch, Fortran] PR 85841: [F2018] reject deleted features

Janus Weil janus@gcc.gnu.org
Sun May 20 12:54:00 GMT 2018


Hi all,

the attached patch deals with the fact that the Fortran 2018 standard
marks two features as "deleted" (i.e. no longer supported), namely
arithmetic IFs and nonblock DO constructs. Both have been obsolescent
since the 90s (and have been warned about by gfortran with appropriate
flags).

Here's what the patch does:
1) It rejects those features with -std=f2018, giving a hard error.
2) It gives a warning with default flags (previously this happened
only with -std=f2008 etc, but not with -std=gnu).

Note that this does not mean that gfortran completely removes support
for these features, of course. They will continue to be supported with
flags like -std=legacy or -std=f95.

The effect on the gfortran.dg testsuite is moderate, but of course
there are a number of test cases which make use of those features. The
solutions is to compile them with -std=legacy.

The patch regtests cleanly on x86_64-linux-gnu. Ok for trunk?

Cheers,
Janus



2018-05-20  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/85841
    * match.c (match_arithmetic_if, gfc_match_if): Reject arithmetic if
    in Fortran 2018.
    (gfc_match_stopcode): Adjust checks for standard version.
    * options.c (set_default_std_flags): Warn for F2018 deleted features
    by default.
    (gfc_handle_option): F2018 deleted features are allowed in earlier
    standards.
    * symbol.c (gfc_define_st_label, gfc_reference_st_label): Reject
    nonblock do constructs in Fortran 2018.


2018-05-20  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/85841
    * gfortran.dg/goacc/loop-1-2.f95: Add option "-std=legacy".
    * gfortran.dg/goacc/loop-1.f95: Ditto.
    * gfortran.dg/gomp/appendix-a/a.6.1.f90: Ditto.
    * gfortran.dg/gomp/appendix-a/a.6.2.f90: Ditto.
    * gfortran.dg/gomp/do-1.f90: Ditto.
    * gfortran.dg/gomp/omp_do1.f90: Ditto.
    * gfortran.dg/pr37243.f: Ditto.
    * gfortran.dg/pr49721-1.f: Ditto.
    * gfortran.dg/pr58484.f: Ditto.
    * gfortran.dg/pr81175.f: Ditto.
    * gfortran.dg/pr81723.f: Ditto.
    * gfortran.dg/predcom-2.f: Ditto.
    * gfortran.dg/vect/Ofast-pr50414.f90: Ditto.
    * gfortran.dg/vect/cost-model-pr34445a.f: Ditto.
    * gfortran.dg/vect/fast-math-mgrid-resid.f: Ditto.
    * gfortran.dg/vect/pr52580.f: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr85841.diff
Type: text/x-patch
Size: 16029 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180520/0e603091/attachment.bin>


More information about the Gcc-patches mailing list