Message ID | CAKwh3qgtHDoSfPDWtFmdCtuwP--fnEyETxtT7Mv3bHYAx4BxkA@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [Fortran] PR 85841: [F2018] reject deleted features | expand |
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). here is a slightly updated version of the patch. While the previous one had to duplicate every invocation of gfc_notify_std like this: if (!gfc_notify_std (GFC_STD_F2018_DEL, ...)) ... if (!gfc_notify_std (GFC_STD_F95_OBS, ...)) ... the new version extends gfc_notify_std, such that it works not only with a single GFC_STD_* flag, but can handle combinations of those. For such a situation, where a single feature can belong to several GFC_STD_* classes, one potentially needs to throw different error or warning messages, depending on the -std= option. The invocation of gfc_notify_std then simplifies to: if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, ...)) ... The patch still regtests cleanly. Ok for trunk? Btw, with the arrival of the F2018 standard, I wonder whether it actually makes sense to keep the option -std=f2008ts, or to remove it in favor of -std=f2018, since the two Technical Specifications covered by this flag are now part of F2018 (and pretty much the main part!). Any opinions on this? Cheers, Janus 2018-05-20 Janus Weil <janus@gcc.gnu.org> PR fortran/85841 * error.c (notify_std_msg): New function. (gfc_notify_std): Adjust such that it can handle combinations of GFC_STD_* flags in the 'std' argument, not just a single one. * 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/g77/19990826-3.f: Add option "-std=legacy". * gfortran.dg/g77/20020307-1.f: Ditto. * gfortran.dg/g77/980310-3.f: Ditto. * gfortran.dg/goacc/loop-1-2.f95: Ditto. * 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/pr17229.f: 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. Index: gcc/fortran/error.c =================================================================== --- gcc/fortran/error.c (revision 260420) +++ gcc/fortran/error.c (working copy) @@ -842,6 +842,40 @@ gfc_notification_std (int std) } +/* Return a string describing the nature of a standard violation + * and/or the relevant version of the standard. */ + +char const* +notify_std_msg(int std) +{ + + if (std & GFC_STD_F2018_DEL) + return _("Fortran 2018 deleted feature:"); + else if (std & GFC_STD_F2018_OBS) + return _("Fortran 2018 obsolescent feature:"); + else if (std & GFC_STD_F2018) + return _("Fortran 2018:"); + else if (std & GFC_STD_F2008_TS) + return "TS 29113/TS 18508:"; + else if (std & GFC_STD_F2008_OBS) + return _("Fortran 2008 obsolescent feature:"); + else if (std & GFC_STD_F2008) + return "Fortran 2008:"; + else if (std & GFC_STD_F2003) + return "Fortran 2003:"; + else if (std & GFC_STD_GNU) + return _("GNU Extension:"); + else if (std & GFC_STD_LEGACY) + return _("Legacy Extension:"); + else if (std & GFC_STD_F95_OBS) + return _("Obsolescent feature:"); + else if (std & GFC_STD_F95_DEL) + return _("Deleted feature:"); + else + gcc_unreachable (); +} + + /* Possibly issue a warning/error about use of a nonstandard (or deleted) feature. An error/warning will be issued if the currently selected standard does not contain the requested bits. Return false if @@ -851,55 +885,24 @@ bool gfc_notify_std (int std, const char *gmsgid, ...) { va_list argp; - bool warning; const char *msg, *msg2; char *buffer; - warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings; - if ((gfc_option.allow_std & std) != 0 && !warning) + /* Determine whether an error or a warning is needed. */ + const int wstd = std & gfc_option.warn_std; /* Standard to warn about. */ + const int estd = std & ~gfc_option.allow_std; /* Standard to error about. */ + const bool warning = (wstd != 0) && !inhibit_warnings; + const bool error = (estd != 0); + + if (!error && !warning) return true; - if (suppress_errors) - return warning ? true : false; + return !error; - switch (std) - { - case GFC_STD_F2018_DEL: - msg = _("Fortran 2018 deleted feature:"); - break; - case GFC_STD_F2018_OBS: - msg = _("Fortran 2018 obsolescent feature:"); - break; - case GFC_STD_F2018: - msg = _("Fortran 2018:"); - break; - case GFC_STD_F2008_TS: - msg = "TS 29113/TS 18508:"; - break; - case GFC_STD_F2008_OBS: - msg = _("Fortran 2008 obsolescent feature:"); - break; - case GFC_STD_F2008: - msg = "Fortran 2008:"; - break; - case GFC_STD_F2003: - msg = "Fortran 2003:"; - break; - case GFC_STD_GNU: - msg = _("GNU Extension:"); - break; - case GFC_STD_LEGACY: - msg = _("Legacy Extension:"); - break; - case GFC_STD_F95_OBS: - msg = _("Obsolescent feature:"); - break; - case GFC_STD_F95_DEL: - msg = _("Deleted feature:"); - break; - default: - gcc_unreachable (); - } + if (error) + msg = notify_std_msg (estd); + else + msg = notify_std_msg (wstd); msg2 = _(gmsgid); buffer = (char *) alloca (strlen (msg) + strlen (msg2) + 2); @@ -908,13 +911,16 @@ gfc_notify_std (int std, const char *gmsgid, ...) strcat (buffer, msg2); va_start (argp, gmsgid); - if (warning) + if (error) + gfc_error_opt (0, buffer, argp); + else gfc_warning (0, buffer, argp); - else - gfc_error_opt (0, buffer, argp); va_end (argp); - return (warning && !warnings_are_errors) ? true : false; + if (error) + return false; + else + return (warning && !warnings_are_errors); } Index: gcc/fortran/match.c =================================================================== --- gcc/fortran/match.c (revision 260420) +++ gcc/fortran/match.c (working copy) @@ -1442,7 +1442,8 @@ match_arithmetic_if (void) return MATCH_ERROR; } - if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) + if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Arithmetic IF statement at %C")) return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; @@ -1522,7 +1523,8 @@ gfc_match_if (gfc_statement *if_type) return MATCH_ERROR; } - if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) + if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Arithmetic IF statement at %C")) return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; @@ -2939,11 +2941,12 @@ gfc_match_stopcode (gfc_statement st) /* Set f95 for -std=f95. */ f95 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS); + | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL); /* Set f03 for -std=f2003. */ f03 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS | GFC_STD_F2003); + | GFC_STD_F2008_OBS | GFC_STD_F2003 + | GFC_STD_F2018_DEL); /* Look for a blank between STOP and the stop-code for F2008 or later. */ if (gfc_current_form != FORM_FIXED && !(f95 || f03)) Index: gcc/fortran/options.c =================================================================== --- gcc/fortran/options.c (revision 260420) +++ gcc/fortran/options.c (working copy) @@ -44,7 +44,7 @@ set_default_std_flags (void) | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS; - gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY; + gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY; } @@ -706,7 +706,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f95: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS; + | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_continue_fixed = 19; gfc_option.max_continue_free = 39; @@ -717,7 +717,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2003: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS; + | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -726,7 +726,8 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2008: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS; + | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS + | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -736,7 +737,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2008ts: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS - | GFC_STD_F2008_TS; + | GFC_STD_F2008_TS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (revision 260420) +++ gcc/fortran/symbol.c (working copy) @@ -2721,9 +2721,9 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type lp->defined = type; if (lp->referenced == ST_LABEL_DO_TARGET && type != ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement " - "which is not END DO or CONTINUE with " - "label %d at %C", labelno)) + && !gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "DO termination statement which is not END DO" + " or CONTINUE with label %d at %C", labelno)) return; break; @@ -2778,8 +2778,8 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_t } if (lp->referenced == ST_LABEL_DO_TARGET && type == ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d " - "at %C", labelno)) + && !gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Shared DO termination label %d at %C", labelno)) return false; if (lp->referenced != ST_LABEL_DO_TARGET) Index: gcc/testsuite/gfortran.dg/g77/19990826-3.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/19990826-3.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/19990826-3.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } * Date: Thu, 19 Aug 1999 10:02:32 +0200 * From: Frederic Devernay <devernay@istar.fr> * Organization: ISTAR @@ -64,7 +65,7 @@ C IF(M2.LT.64)INDE=5 IF(M2.LT.32)INDE=4 DO 3 NUN =3,INUN - DO 3 NDE=3,INDE ! { dg-warning "Obsolescent feature: Shared DO termination" } + DO 3 NDE=3,INDE N10=2**NUN N20=2**NDE NDIF=(N10-N20) Index: gcc/testsuite/gfortran.dg/g77/20020307-1.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/20020307-1.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/20020307-1.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } SUBROUTINE SWEEP PARAMETER(MAXDIM=4,MAXVEC=4**3*8,MAXT=20) REAL(KIND=8) B,W1,W2,BNORM,BINV,WT,W0,C1,C2,R1,R2 @@ -6,7 +7,7 @@ c { dg-do compile } DIMENSION BNORM(MAXVEC),BINV(MAXVEC),WT(MAXVEC),W0(MAXVEC) DIMENSION C1(MAXVEC),C2(MAXVEC),R1(MAXVEC),R2(MAXVEC) DO 200 ILAT=1,2**IDIM - DO 200 I1=1,IDIM ! { dg-warning "Obsolescent feature: Shared DO termination" } + DO 200 I1=1,IDIM DO 220 I2=1,IDIM CALL INTACT(ILAT,I1,I1,W1) 220 CONTINUE Index: gcc/testsuite/gfortran.dg/g77/980310-3.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/980310-3.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/980310-3.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } c c This demonstrates a problem with g77 and pic on x86 where c egcs 1.0.1 and earlier will generate bogus assembler output. @@ -128,7 +129,7 @@ c compute right side vector in resulting linea c basl = dlog10(2.0d0) do 240 i = low,igh - do 240 j = low,igh ! { dg-warning "Obsolescent feature: Shared DO termination" } + do 240 j = low,igh tb = b(i,j) ta = a(i,j) if (ta .eq. 0.0d0) go to 220 @@ -242,7 +243,7 @@ c ir = wk(i,1) fi = 2.0d0**ir if (i .lt. low) fi = 1.0d0 - do 400 j =low,n ! { dg-warning "Obsolescent feature: Shared DO termination" } + do 400 j =low,n jc = cscale(j) fj = 2.0d0**jc if (j .le. igh) go to 390 Index: gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (revision 260420) +++ gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1.f95. +! { dg-additional-options "-std=legacy" } program test call test1 @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/goacc/loop-1.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (revision 260420) +++ gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1-2.f95. +! { dg-additional-options "-std=legacy" } module test implicit none @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-additional-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/do-1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/do-1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/do-1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O -fopenmp -fdump-tree-omplower" } +! { dg-options "-O -fopenmp -fdump-tree-omplower -std=legacy" } subroutine foo (i, j, k, s, a) integer :: i, j, k, s, a(100), l Index: gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-fopenmp -std=gnu" } +! { dg-options "-fopenmp -std=legacy" } subroutine foo integer :: i, j integer, dimension (30) :: a @@ -24,11 +24,11 @@ subroutine foo i = i + 1 end do !$omp do - do 300 d = 1, 30, 6 ! { dg-warning "Deleted feature: Loop variable" } + do 300 d = 1, 30, 6 i = d 300 a(i) = 1 !$omp do - do d = 1, 30, 5 ! { dg-warning "Deleted feature: Loop variable" } + do d = 1, 30, 5 i = d a(i) = 2 end do Index: gcc/testsuite/gfortran.dg/pr17229.f =================================================================== --- gcc/testsuite/gfortran.dg/pr17229.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr17229.f (working copy) @@ -1,5 +1,6 @@ ! PR fortran/17229 ! { dg-do run } +! { dg-options "-std=legacy" } integer i logical l @@ -6,18 +7,18 @@ l = .false. i = -1 - if (l) if (i) 999,999,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,999,999 l = .true. - if (l) if (i) 10,999,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 10,999,999 go to 999 10 i = 0 - if (l) if (i) 999,20,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,20,999 go to 999 20 i = 1 - if (l) if (i) 999,999,30 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,999,30 go to 999 999 STOP 1 Index: gcc/testsuite/gfortran.dg/pr37243.f =================================================================== --- gcc/testsuite/gfortran.dg/pr37243.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr37243.f (working copy) @@ -1,5 +1,6 @@ ! PR rtl-optimization/37243 ! { dg-do run } +! { dg-options "-std=legacy" } ! { dg-add-options ieee } ! Check if register allocator handles IR flattening correctly. SUBROUTINE SCHMD(V,M,N,LDV) @@ -13,10 +14,10 @@ DO 160 I = 1,M DUMI = ZERO DO 100 K = 1,N - 100 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 100 DUMI = DUMI+V(K,I)*V(K,I) DUMI = ONE/ SQRT(DUMI) DO 120 K = 1,N - 120 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 120 V(K,I) = V(K,I)*DUMI IF (I .EQ. M) GO TO 160 I1 = I+1 DO 140 J = I1,M @@ -34,15 +35,15 @@ 220 J = J+1 IF (J .GT. N) GO TO 320 DO 240 K = 1,N - 240 V(K,I) = ZERO ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 240 V(K,I) = ZERO CALL DAXPY(N,DUM,V(1,I),1,V(1,I),1) 260 CONTINUE DUMI = ZERO DO 280 K = 1,N - 280 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 280 DUMI = DUMI+V(K,I)*V(K,I) IF ( ABS(DUMI) .LT. TOL) GO TO 220 DO 300 K = 1,N - 300 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 300 V(K,I) = V(K,I)*DUMI GO TO 200 320 END program main Index: gcc/testsuite/gfortran.dg/pr49721-1.f =================================================================== --- gcc/testsuite/gfortran.dg/pr49721-1.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr49721-1.f (working copy) @@ -1,6 +1,6 @@ ! PR middle-end/49721 ! { dg-do compile } -! { dg-options "-O3 -funroll-loops" } +! { dg-options "-O3 -funroll-loops -std=legacy" } subroutine midbloc6(c,a2,a2i,q) parameter (ndim2=6) Index: gcc/testsuite/gfortran.dg/pr58484.f =================================================================== --- gcc/testsuite/gfortran.dg/pr58484.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr58484.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O2" } +! { dg-options "-O2 -std=legacy" } SUBROUTINE UMPSE(AIBJ,NOC,NDIM,NOCA,NVIRA,NOCCA,E2) DIMENSION AIBJ(NOC,NDIM,*) DO 20 MA=1,NVIRA Index: gcc/testsuite/gfortran.dg/pr81175.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81175.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr81175.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-Ofast -fwrapv" } +! { dg-options "-Ofast -fwrapv -std=legacy" } ! { dg-additional-options "-march=broadwell" { target x86_64-*-* i?86-*-* } } SUBROUTINE ECPDRA(IC4C,FP,FQ,G) IMPLICIT DOUBLE PRECISION (A-H,O-Z) Index: gcc/testsuite/gfortran.dg/pr81723.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81723.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr81723.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O3 -fno-automatic" } +! { dg-options "-O3 -fno-automatic -std=legacy" } FUNCTION WWERF(Z) Index: gcc/testsuite/gfortran.dg/predcom-2.f =================================================================== --- gcc/testsuite/gfortran.dg/predcom-2.f (revision 260420) +++ gcc/testsuite/gfortran.dg/predcom-2.f (working copy) @@ -1,7 +1,7 @@ ! PR 32220, ICE when the loop is not unrolled enough to eliminate all ! register copies ! { dg-do compile } -! { dg-options "-O3" } +! { dg-options "-O3 -std=legacy" } subroutine derv (b,cosxy,thick) c Index: gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 =================================================================== --- gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE SUB (A,L,YMAX) DIMENSION A(L) Index: gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } subroutine derv (xx,b,bv,det,r,s,t,ndopt,cosxy,thick,edis, 1 vni,vnt) implicit real*8 (a-h,o-z) Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (working copy) @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-require-effective-target vect_double } -! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details" } +! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details -std=legacy" } ! { dg-additional-options "-mprefer-avx128" { target { i?86-*-* x86_64-*-* } } } ! { dg-additional-options "-mzarch" { target { s390*-*-* } } } Index: gcc/testsuite/gfortran.dg/vect/pr52580.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/pr52580.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/pr52580.f (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } ! { dg-require-effective-target vect_double } SUBROUTINE CALC2 IMPLICIT REAL*8 (A-H, O-Z)
On Sun, May 20, 2018 at 07:28:49PM +0200, Janus Weil wrote: > > > 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). > > here is a slightly updated version of the patch. While the previous > one had to duplicate every invocation of gfc_notify_std like this: > > if (!gfc_notify_std (GFC_STD_F2018_DEL, ...)) ... > if (!gfc_notify_std (GFC_STD_F95_OBS, ...)) ... > > the new version extends gfc_notify_std, such that it works not only > with a single GFC_STD_* flag, but can handle combinations of those. > For such a situation, where a single feature can belong to several > GFC_STD_* classes, one potentially needs to throw different error or > warning messages, depending on the -std= option. The invocation of > gfc_notify_std then simplifies to: > > if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, ...)) ... > > The patch still regtests cleanly. Ok for trunk? Patch looks good to me. The only thing that worries me is whether the patch will cause the SPEC benchmark to throw an error or warning that it did not before. As I don't have SPEC benchmark and it cost $$$, I'm not going to let it bother too much. > Btw, with the arrival of the F2018 standard, I wonder whether it > actually makes sense to keep the option -std=f2008ts, or to remove it > in favor of -std=f2018, since the two Technical Specifications covered > by this flag are now part of F2018 (and pretty much the main part!). > Any opinions on this? I think that f2008ts can go away. We may need to do this in two step as some users may have f2008ts hardcoded in Makefiles. Probably, issue warning for -std=2008ts and map it to -std=2018 for a brief period (3 to 6 months?) and then finally remove it.
Hi Steve, thanks for your comments! >> The patch still regtests cleanly. Ok for trunk? > > Patch looks good to me. The only thing that worries me is > whether the patch will cause the SPEC benchmark to throw > an error or warning that it did not before. As I don't have > SPEC benchmark and it cost $$$, I'm not going to let it > bother too much. Unfortunately I don't have access to SPEC either. Is anyone in a position to check this? If it is indeed a problem, I could remove the warning for the F2018 deleted features with default flags (-std=gnu). However, I'd only like to do that if it's really necessary. >> Btw, with the arrival of the F2018 standard, I wonder whether it >> actually makes sense to keep the option -std=f2008ts, or to remove it >> in favor of -std=f2018, since the two Technical Specifications covered >> by this flag are now part of F2018 (and pretty much the main part!). >> Any opinions on this? > > I think that f2008ts can go away. We may need to do this > in two step as some users may have f2008ts hardcoded in > Makefiles. Probably, issue warning for -std=2008ts and > map it to -std=2018 for a brief period (3 to 6 months?) > and then finally remove it. Yes, I agree that it would be a good idea to keep -std=f2008ts as an alias for f2018 for a while (possibly until the next release, 9.0), and document is as deprecated. I can take care of removing the GFC_STD_F2008_TS macro in a follow-up patch. Actually there is one other thing I do not like about my previous patch: The duplication of GFC_STD_* flags in gfc_match_stopcode. To get rid of this, I'm introducing additional macros in libgfortran.h, see new patch in the attachment. I hope you agree that this is an improvement. (Again: Regtests cleanly.) Cheers, Janus Index: gcc/fortran/error.c =================================================================== --- gcc/fortran/error.c (revision 260420) +++ gcc/fortran/error.c (working copy) @@ -842,6 +842,40 @@ gfc_notification_std (int std) } +/* Return a string describing the nature of a standard violation + * and/or the relevant version of the standard. */ + +char const* +notify_std_msg(int std) +{ + + if (std & GFC_STD_F2018_DEL) + return _("Fortran 2018 deleted feature:"); + else if (std & GFC_STD_F2018_OBS) + return _("Fortran 2018 obsolescent feature:"); + else if (std & GFC_STD_F2018) + return _("Fortran 2018:"); + else if (std & GFC_STD_F2008_TS) + return "TS 29113/TS 18508:"; + else if (std & GFC_STD_F2008_OBS) + return _("Fortran 2008 obsolescent feature:"); + else if (std & GFC_STD_F2008) + return "Fortran 2008:"; + else if (std & GFC_STD_F2003) + return "Fortran 2003:"; + else if (std & GFC_STD_GNU) + return _("GNU Extension:"); + else if (std & GFC_STD_LEGACY) + return _("Legacy Extension:"); + else if (std & GFC_STD_F95_OBS) + return _("Obsolescent feature:"); + else if (std & GFC_STD_F95_DEL) + return _("Deleted feature:"); + else + gcc_unreachable (); +} + + /* Possibly issue a warning/error about use of a nonstandard (or deleted) feature. An error/warning will be issued if the currently selected standard does not contain the requested bits. Return false if @@ -851,55 +885,24 @@ bool gfc_notify_std (int std, const char *gmsgid, ...) { va_list argp; - bool warning; const char *msg, *msg2; char *buffer; - warning = ((gfc_option.warn_std & std) != 0) && !inhibit_warnings; - if ((gfc_option.allow_std & std) != 0 && !warning) + /* Determine whether an error or a warning is needed. */ + const int wstd = std & gfc_option.warn_std; /* Standard to warn about. */ + const int estd = std & ~gfc_option.allow_std; /* Standard to error about. */ + const bool warning = (wstd != 0) && !inhibit_warnings; + const bool error = (estd != 0); + + if (!error && !warning) return true; - if (suppress_errors) - return warning ? true : false; + return !error; - switch (std) - { - case GFC_STD_F2018_DEL: - msg = _("Fortran 2018 deleted feature:"); - break; - case GFC_STD_F2018_OBS: - msg = _("Fortran 2018 obsolescent feature:"); - break; - case GFC_STD_F2018: - msg = _("Fortran 2018:"); - break; - case GFC_STD_F2008_TS: - msg = "TS 29113/TS 18508:"; - break; - case GFC_STD_F2008_OBS: - msg = _("Fortran 2008 obsolescent feature:"); - break; - case GFC_STD_F2008: - msg = "Fortran 2008:"; - break; - case GFC_STD_F2003: - msg = "Fortran 2003:"; - break; - case GFC_STD_GNU: - msg = _("GNU Extension:"); - break; - case GFC_STD_LEGACY: - msg = _("Legacy Extension:"); - break; - case GFC_STD_F95_OBS: - msg = _("Obsolescent feature:"); - break; - case GFC_STD_F95_DEL: - msg = _("Deleted feature:"); - break; - default: - gcc_unreachable (); - } + if (error) + msg = notify_std_msg (estd); + else + msg = notify_std_msg (wstd); msg2 = _(gmsgid); buffer = (char *) alloca (strlen (msg) + strlen (msg2) + 2); @@ -908,13 +911,16 @@ gfc_notify_std (int std, const char *gmsgid, ...) strcat (buffer, msg2); va_start (argp, gmsgid); - if (warning) + if (error) + gfc_error_opt (0, buffer, argp); + else gfc_warning (0, buffer, argp); - else - gfc_error_opt (0, buffer, argp); va_end (argp); - return (warning && !warnings_are_errors) ? true : false; + if (error) + return false; + else + return (warning && !warnings_are_errors); } Index: gcc/fortran/libgfortran.h =================================================================== --- gcc/fortran/libgfortran.h (revision 260420) +++ gcc/fortran/libgfortran.h (working copy) @@ -37,6 +37,16 @@ along with GCC; see the file COPYING3. If not see #define GFC_STD_F77 (1<<0) /* Included in F77, but not deleted or obsolescent in later standards. */ +/* Combinations of the above flags that specify which classes of features + * are allowed with a certain -std option. */ +#define GFC_STD_OPT_F95 (GFC_STD_F77 | GFC_STD_F95 | GFC_STD_F95_OBS \ + | GFC_STD_F2008_OBS | GFC_STD_F2018_OBS \ + | GFC_STD_F2018_DEL) +#define GFC_STD_OPT_F03 (GFC_STD_OPT_F95 | GFC_STD_F2003) +#define GFC_STD_OPT_F08 (GFC_STD_OPT_F03 | GFC_STD_F2008) +#define GFC_STD_OPT_F08TS (GFC_STD_OPT_F08 | GFC_STD_F2008_TS) +#define GFC_STD_OPT_F18 ((GFC_STD_OPT_F08TS | GFC_STD_F2018) \ + & (~GFC_STD_F2018_DEL)) /* Bitmasks for the various FPE that can be enabled. These need to be straight integers e.g., 8 instead of (1<<3), because they will be included in Fortran source. */ Index: gcc/fortran/match.c =================================================================== --- gcc/fortran/match.c (revision 260420) +++ gcc/fortran/match.c (working copy) @@ -1442,7 +1442,8 @@ match_arithmetic_if (void) return MATCH_ERROR; } - if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) + if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Arithmetic IF statement at %C")) return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; @@ -1522,7 +1523,8 @@ gfc_match_if (gfc_statement *if_type) return MATCH_ERROR; } - if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) + if (!gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Arithmetic IF statement at %C")) return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; @@ -2938,12 +2940,10 @@ gfc_match_stopcode (gfc_statement st) bool f95, f03; /* Set f95 for -std=f95. */ - f95 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS); + f95 = (gfc_option.allow_std == GFC_STD_OPT_F95); /* Set f03 for -std=f2003. */ - f03 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS | GFC_STD_F2003); + f03 = (gfc_option.allow_std == GFC_STD_OPT_F03); /* Look for a blank between STOP and the stop-code for F2008 or later. */ if (gfc_current_form != FORM_FIXED && !(f95 || f03)) Index: gcc/fortran/options.c =================================================================== --- gcc/fortran/options.c (revision 260420) +++ gcc/fortran/options.c (working copy) @@ -44,7 +44,7 @@ set_default_std_flags (void) | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS; - gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY; + gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY; } @@ -705,8 +705,7 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f95: - gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS; + gfc_option.allow_std = GFC_STD_OPT_F95; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_continue_fixed = 19; gfc_option.max_continue_free = 39; @@ -716,8 +715,7 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f2003: - gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS; + gfc_option.allow_std = GFC_STD_OPT_F03; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -725,8 +723,7 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f2008: - gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS; + gfc_option.allow_std = GFC_STD_OPT_F08; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -734,9 +731,7 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f2008ts: - gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS - | GFC_STD_F2008_TS; + gfc_option.allow_std = GFC_STD_OPT_F08TS; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -744,9 +739,7 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f2018: - gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS - | GFC_STD_F2008_TS | GFC_STD_F2018 | GFC_STD_F2018_OBS; + gfc_option.allow_std = GFC_STD_OPT_F18; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS | GFC_STD_F2018_OBS; gfc_option.max_identifier_length = 63; Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (revision 260420) +++ gcc/fortran/symbol.c (working copy) @@ -2721,9 +2721,9 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type lp->defined = type; if (lp->referenced == ST_LABEL_DO_TARGET && type != ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement " - "which is not END DO or CONTINUE with " - "label %d at %C", labelno)) + && !gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "DO termination statement which is not END DO" + " or CONTINUE with label %d at %C", labelno)) return; break; @@ -2778,8 +2778,8 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_t } if (lp->referenced == ST_LABEL_DO_TARGET && type == ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d " - "at %C", labelno)) + && !gfc_notify_std (GFC_STD_F95_OBS | GFC_STD_F2018_DEL, + "Shared DO termination label %d at %C", labelno)) return false; if (lp->referenced != ST_LABEL_DO_TARGET) Index: gcc/testsuite/gfortran.dg/g77/19990826-3.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/19990826-3.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/19990826-3.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } * Date: Thu, 19 Aug 1999 10:02:32 +0200 * From: Frederic Devernay <devernay@istar.fr> * Organization: ISTAR @@ -64,7 +65,7 @@ C IF(M2.LT.64)INDE=5 IF(M2.LT.32)INDE=4 DO 3 NUN =3,INUN - DO 3 NDE=3,INDE ! { dg-warning "Obsolescent feature: Shared DO termination" } + DO 3 NDE=3,INDE N10=2**NUN N20=2**NDE NDIF=(N10-N20) Index: gcc/testsuite/gfortran.dg/g77/20020307-1.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/20020307-1.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/20020307-1.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } SUBROUTINE SWEEP PARAMETER(MAXDIM=4,MAXVEC=4**3*8,MAXT=20) REAL(KIND=8) B,W1,W2,BNORM,BINV,WT,W0,C1,C2,R1,R2 @@ -6,7 +7,7 @@ c { dg-do compile } DIMENSION BNORM(MAXVEC),BINV(MAXVEC),WT(MAXVEC),W0(MAXVEC) DIMENSION C1(MAXVEC),C2(MAXVEC),R1(MAXVEC),R2(MAXVEC) DO 200 ILAT=1,2**IDIM - DO 200 I1=1,IDIM ! { dg-warning "Obsolescent feature: Shared DO termination" } + DO 200 I1=1,IDIM DO 220 I2=1,IDIM CALL INTACT(ILAT,I1,I1,W1) 220 CONTINUE Index: gcc/testsuite/gfortran.dg/g77/980310-3.f =================================================================== --- gcc/testsuite/gfortran.dg/g77/980310-3.f (revision 260420) +++ gcc/testsuite/gfortran.dg/g77/980310-3.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } c c This demonstrates a problem with g77 and pic on x86 where c egcs 1.0.1 and earlier will generate bogus assembler output. @@ -128,7 +129,7 @@ c compute right side vector in resulting linea c basl = dlog10(2.0d0) do 240 i = low,igh - do 240 j = low,igh ! { dg-warning "Obsolescent feature: Shared DO termination" } + do 240 j = low,igh tb = b(i,j) ta = a(i,j) if (ta .eq. 0.0d0) go to 220 @@ -242,7 +243,7 @@ c ir = wk(i,1) fi = 2.0d0**ir if (i .lt. low) fi = 1.0d0 - do 400 j =low,n ! { dg-warning "Obsolescent feature: Shared DO termination" } + do 400 j =low,n jc = cscale(j) fj = 2.0d0**jc if (j .le. igh) go to 390 Index: gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (revision 260420) +++ gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1.f95. +! { dg-additional-options "-std=legacy" } program test call test1 @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/goacc/loop-1.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (revision 260420) +++ gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1-2.f95. +! { dg-additional-options "-std=legacy" } module test implicit none @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-additional-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/do-1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/do-1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/do-1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O -fopenmp -fdump-tree-omplower" } +! { dg-options "-O -fopenmp -fdump-tree-omplower -std=legacy" } subroutine foo (i, j, k, s, a) integer :: i, j, k, s, a(100), l Index: gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-fopenmp -std=gnu" } +! { dg-options "-fopenmp -std=legacy" } subroutine foo integer :: i, j integer, dimension (30) :: a @@ -24,11 +24,11 @@ subroutine foo i = i + 1 end do !$omp do - do 300 d = 1, 30, 6 ! { dg-warning "Deleted feature: Loop variable" } + do 300 d = 1, 30, 6 i = d 300 a(i) = 1 !$omp do - do d = 1, 30, 5 ! { dg-warning "Deleted feature: Loop variable" } + do d = 1, 30, 5 i = d a(i) = 2 end do Index: gcc/testsuite/gfortran.dg/pr17229.f =================================================================== --- gcc/testsuite/gfortran.dg/pr17229.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr17229.f (working copy) @@ -1,5 +1,6 @@ ! PR fortran/17229 ! { dg-do run } +! { dg-options "-std=legacy" } integer i logical l @@ -6,18 +7,18 @@ l = .false. i = -1 - if (l) if (i) 999,999,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,999,999 l = .true. - if (l) if (i) 10,999,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 10,999,999 go to 999 10 i = 0 - if (l) if (i) 999,20,999 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,20,999 go to 999 20 i = 1 - if (l) if (i) 999,999,30 ! { dg-warning "Obsolescent feature" } + if (l) if (i) 999,999,30 go to 999 999 STOP 1 Index: gcc/testsuite/gfortran.dg/pr37243.f =================================================================== --- gcc/testsuite/gfortran.dg/pr37243.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr37243.f (working copy) @@ -1,5 +1,6 @@ ! PR rtl-optimization/37243 ! { dg-do run } +! { dg-options "-std=legacy" } ! { dg-add-options ieee } ! Check if register allocator handles IR flattening correctly. SUBROUTINE SCHMD(V,M,N,LDV) @@ -13,10 +14,10 @@ DO 160 I = 1,M DUMI = ZERO DO 100 K = 1,N - 100 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 100 DUMI = DUMI+V(K,I)*V(K,I) DUMI = ONE/ SQRT(DUMI) DO 120 K = 1,N - 120 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 120 V(K,I) = V(K,I)*DUMI IF (I .EQ. M) GO TO 160 I1 = I+1 DO 140 J = I1,M @@ -34,15 +35,15 @@ 220 J = J+1 IF (J .GT. N) GO TO 320 DO 240 K = 1,N - 240 V(K,I) = ZERO ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 240 V(K,I) = ZERO CALL DAXPY(N,DUM,V(1,I),1,V(1,I),1) 260 CONTINUE DUMI = ZERO DO 280 K = 1,N - 280 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 280 DUMI = DUMI+V(K,I)*V(K,I) IF ( ABS(DUMI) .LT. TOL) GO TO 220 DO 300 K = 1,N - 300 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 300 V(K,I) = V(K,I)*DUMI GO TO 200 320 END program main Index: gcc/testsuite/gfortran.dg/pr49721-1.f =================================================================== --- gcc/testsuite/gfortran.dg/pr49721-1.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr49721-1.f (working copy) @@ -1,6 +1,6 @@ ! PR middle-end/49721 ! { dg-do compile } -! { dg-options "-O3 -funroll-loops" } +! { dg-options "-O3 -funroll-loops -std=legacy" } subroutine midbloc6(c,a2,a2i,q) parameter (ndim2=6) Index: gcc/testsuite/gfortran.dg/pr58484.f =================================================================== --- gcc/testsuite/gfortran.dg/pr58484.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr58484.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O2" } +! { dg-options "-O2 -std=legacy" } SUBROUTINE UMPSE(AIBJ,NOC,NDIM,NOCA,NVIRA,NOCCA,E2) DIMENSION AIBJ(NOC,NDIM,*) DO 20 MA=1,NVIRA Index: gcc/testsuite/gfortran.dg/pr81175.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81175.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr81175.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-Ofast -fwrapv" } +! { dg-options "-Ofast -fwrapv -std=legacy" } ! { dg-additional-options "-march=broadwell" { target x86_64-*-* i?86-*-* } } SUBROUTINE ECPDRA(IC4C,FP,FQ,G) IMPLICIT DOUBLE PRECISION (A-H,O-Z) Index: gcc/testsuite/gfortran.dg/pr81723.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81723.f (revision 260420) +++ gcc/testsuite/gfortran.dg/pr81723.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O3 -fno-automatic" } +! { dg-options "-O3 -fno-automatic -std=legacy" } FUNCTION WWERF(Z) Index: gcc/testsuite/gfortran.dg/predcom-2.f =================================================================== --- gcc/testsuite/gfortran.dg/predcom-2.f (revision 260420) +++ gcc/testsuite/gfortran.dg/predcom-2.f (working copy) @@ -1,7 +1,7 @@ ! PR 32220, ICE when the loop is not unrolled enough to eliminate all ! register copies ! { dg-do compile } -! { dg-options "-O3" } +! { dg-options "-O3 -std=legacy" } subroutine derv (b,cosxy,thick) c Index: gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 =================================================================== --- gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE SUB (A,L,YMAX) DIMENSION A(L) Index: gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } subroutine derv (xx,b,bv,det,r,s,t,ndopt,cosxy,thick,edis, 1 vni,vnt) implicit real*8 (a-h,o-z) Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (working copy) @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-require-effective-target vect_double } -! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details" } +! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details -std=legacy" } ! { dg-additional-options "-mprefer-avx128" { target { i?86-*-* x86_64-*-* } } } ! { dg-additional-options "-mzarch" { target { s390*-*-* } } } Index: gcc/testsuite/gfortran.dg/vect/pr52580.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/pr52580.f (revision 260420) +++ gcc/testsuite/gfortran.dg/vect/pr52580.f (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } ! { dg-require-effective-target vect_double } SUBROUTINE CALC2 IMPLICIT REAL*8 (A-H, O-Z)
On Sun, May 20, 2018 at 09:44:47PM +0200, Janus Weil wrote: > > >> The patch still regtests cleanly. Ok for trunk? > > > > Patch looks good to me. The only thing that worries me is > > whether the patch will cause the SPEC benchmark to throw > > an error or warning that it did not before. As I don't have > > SPEC benchmark and it cost $$$, I'm not going to let it > > bother too much. > > Unfortunately I don't have access to SPEC either. Is anyone in a > position to check this? We'll find out evidently as one of the C/C++ developers run SPEC. > If it is indeed a problem, I could remove the warning for the F2018 > deleted features with default flags (-std=gnu). However, I'd only like > to do that if it's really necessary. I would rather see the warnings to encourage users to fix their codes. If they don't want to see the warnings, they can use -w. > >> Btw, with the arrival of the F2018 standard, I wonder whether it > >> actually makes sense to keep the option -std=f2008ts, or to remove it > >> in favor of -std=f2018, since the two Technical Specifications covered > >> by this flag are now part of F2018 (and pretty much the main part!). > >> Any opinions on this? > > > > I think that f2008ts can go away. We may need to do this > > in two step as some users may have f2008ts hardcoded in > > Makefiles. Probably, issue warning for -std=2008ts and > > map it to -std=2018 for a brief period (3 to 6 months?) > > and then finally remove it. > > Yes, I agree that it would be a good idea to keep -std=f2008ts as an > alias for f2018 for a while (possibly until the next release, 9.0), > and document is as deprecated. I can take care of removing the > GFC_STD_F2008_TS macro in a follow-up patch. Sounds good to me. > Actually there is one other thing I do not like about my previous > patch: The duplication of GFC_STD_* flags in gfc_match_stopcode. To > get rid of this, I'm introducing additional macros in libgfortran.h, > see new patch in the attachment. I hope you agree that this is an > improvement. (Again: Regtests cleanly.) Again, looks good. Thanks for doing a boring janitor task of cleaning up loose ends. Welcome back to gfortran development. Please stay away, we can use the help. :-)
2018-05-21 0:19 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: > On Sun, May 20, 2018 at 09:44:47PM +0200, Janus Weil wrote: >> >> >> The patch still regtests cleanly. Ok for trunk? >> > >> > Patch looks good to me. The only thing that worries me is >> > whether the patch will cause the SPEC benchmark to throw >> > an error or warning that it did not before. As I don't have >> > SPEC benchmark and it cost $$$, I'm not going to let it >> > bother too much. >> >> Unfortunately I don't have access to SPEC either. Is anyone in a >> position to check this? > > We'll find out evidently as one of the C/C++ developers run SPEC. Ok, we have plenty of time to fix up things before the next release anyway. >> If it is indeed a problem, I could remove the warning for the F2018 >> deleted features with default flags (-std=gnu). However, I'd only like >> to do that if it's really necessary. > > I would rather see the warnings to encourage users to fix > their codes. Me too. Good that we can agree on something for once ;) >> >> Btw, with the arrival of the F2018 standard, I wonder whether it >> >> actually makes sense to keep the option -std=f2008ts, or to remove it >> >> in favor of -std=f2018, since the two Technical Specifications covered >> >> by this flag are now part of F2018 (and pretty much the main part!). >> >> Any opinions on this? >> > >> > I think that f2008ts can go away. We may need to do this >> > in two step as some users may have f2008ts hardcoded in >> > Makefiles. Probably, issue warning for -std=2008ts and >> > map it to -std=2018 for a brief period (3 to 6 months?) >> > and then finally remove it. >> >> Yes, I agree that it would be a good idea to keep -std=f2008ts as an >> alias for f2018 for a while (possibly until the next release, 9.0), >> and document is as deprecated. I can take care of removing the >> GFC_STD_F2008_TS macro in a follow-up patch. > > Sounds good to me. > >> Actually there is one other thing I do not like about my previous >> patch: The duplication of GFC_STD_* flags in gfc_match_stopcode. To >> get rid of this, I'm introducing additional macros in libgfortran.h, >> see new patch in the attachment. I hope you agree that this is an >> improvement. (Again: Regtests cleanly.) > > Again, looks good. Thanks. I have committed this version of the patch as r260433. > Welcome back to gfortran development. Well, I do have a continued interest in improving gfortran. As usual, I cannot make any promises (too many boundary conditions), but I will certainly try to make the occasional contribution if I find the time. It would be amazing to finally have complete Fortran 2003 support with gfortran-9. I guess we're really only a handful of PRs away from that goal now. Many of the small F2018 improvements should not be too hard to implement either. Cheers, Janus
>> >> Btw, with the arrival of the F2018 standard, I wonder whether it >> >> actually makes sense to keep the option -std=f2008ts, or to remove it >> >> in favor of -std=f2018, since the two Technical Specifications covered >> >> by this flag are now part of F2018 (and pretty much the main part!). >> >> Any opinions on this? >> > >> > I think that f2008ts can go away. We may need to do this >> > in two step as some users may have f2008ts hardcoded in >> > Makefiles. Probably, issue warning for -std=2008ts and >> > map it to -std=2018 for a brief period (3 to 6 months?) >> > and then finally remove it. >> >> Yes, I agree that it would be a good idea to keep -std=f2008ts as an >> alias for f2018 for a while (possibly until the next release, 9.0), >> and document is as deprecated. I can take care of removing the >> GFC_STD_F2008_TS macro in a follow-up patch. > > Sounds good to me. So, here is the promised follow-up patch. It mostly removes GFC_STD_F2008_TS and replaces it by GFC_STD_F2018 in a mechanical manner. Plus, it fixes the resulting fallout in the testsuite and updates the documentation. The non-mechanical parts are libgfortran.h and options.c. Regtests cleanly. Ok for trunk with a suitable ChangeLog? Cheers, Janus Index: gcc/fortran/array.c =================================================================== --- gcc/fortran/array.c (revision 260433) +++ gcc/fortran/array.c (working copy) @@ -533,7 +533,7 @@ gfc_match_array_spec (gfc_array_spec **asp, bool m as->type = AS_ASSUMED_RANK; as->rank = -1; - if (!gfc_notify_std (GFC_STD_F2008_TS, "Assumed-rank array at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "Assumed-rank array at %C")) goto cleanup; if (!match_codim) Index: gcc/fortran/check.c =================================================================== --- gcc/fortran/check.c (revision 260433) +++ gcc/fortran/check.c (working copy) @@ -1136,7 +1136,7 @@ gfc_check_atomic (gfc_expr *atom, int atom_no, gfc if (!kind_value_check (stat, stat_no, gfc_default_integer_kind)) return false; - if (!gfc_notify_std (GFC_STD_F2008_TS, "STAT= argument to %s at %L", + if (!gfc_notify_std (GFC_STD_F2018, "STAT= argument to %s at %L", gfc_current_intrinsic, &stat->where)) return false; } @@ -1349,7 +1349,7 @@ gfc_check_event_query (gfc_expr *event, gfc_expr * if (!variable_check (stat, 2, false)) return false; - if (!gfc_notify_std (GFC_STD_F2008_TS, "STAT= argument to %s at %L", + if (!gfc_notify_std (GFC_STD_F2018, "STAT= argument to %s at %L", gfc_current_intrinsic, &stat->where)) return false; } @@ -4745,7 +4745,7 @@ gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *f } if (fptr->rank > 0 && !is_c_interoperable (fptr, &msg, false, true)) - return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable array FPTR " + return gfc_notify_std (GFC_STD_F2018, "Noninteroperable array FPTR " "at %L to C_F_POINTER: %s", &fptr->where, msg); return true; @@ -4786,7 +4786,7 @@ gfc_check_c_f_procpointer (gfc_expr *cptr, gfc_exp } if (!attr.is_bind_c) - return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure " + return gfc_notify_std (GFC_STD_F2018, "Noninteroperable procedure " "pointer at %L to C_F_PROCPOINTER", &fptr->where); return true; @@ -4829,7 +4829,7 @@ gfc_check_c_funloc (gfc_expr *x) } if (!attr.is_bind_c) - return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure " + return gfc_notify_std (GFC_STD_F2018, "Noninteroperable procedure " "at %L to C_FUNLOC", &x->where); return true; } @@ -4883,7 +4883,7 @@ gfc_check_c_loc (gfc_expr *x) } if (x->rank - && !gfc_notify_std (GFC_STD_F2008_TS, + && !gfc_notify_std (GFC_STD_F2018, "Noninteroperable array at %L as" " argument to C_LOC: %s", &x->where, msg)) return false; @@ -5267,7 +5267,7 @@ gfc_check_num_images (gfc_expr *distance, gfc_expr if (!scalar_check (distance, 0)) return false; - if (!gfc_notify_std (GFC_STD_F2008_TS, "DISTANCE= argument to " + if (!gfc_notify_std (GFC_STD_F2018, "DISTANCE= argument to " "NUM_IMAGES at %L", &distance->where)) return false; } @@ -5280,7 +5280,7 @@ gfc_check_num_images (gfc_expr *distance, gfc_expr if (!scalar_check (failed, 1)) return false; - if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to " + if (!gfc_notify_std (GFC_STD_F2018, "FAILED= argument to " "NUM_IMAGES at %L", &failed->where)) return false; } @@ -5366,7 +5366,7 @@ gfc_check_this_image (gfc_expr *coarray, gfc_expr if (!scalar_check (distance, 2)) return false; - if (!gfc_notify_std (GFC_STD_F2008_TS, "DISTANCE= argument to " + if (!gfc_notify_std (GFC_STD_F2018, "DISTANCE= argument to " "THIS_IMAGE at %L", &distance->where)) return false; Index: gcc/fortran/decl.c =================================================================== --- gcc/fortran/decl.c (revision 260433) +++ gcc/fortran/decl.c (working copy) @@ -1401,7 +1401,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) not have the allocatable, pointer, or optional attributes, according to J3/04-007, section 5.1. */ if (sym->attr.allocatable == 1 - && !gfc_notify_std (GFC_STD_F2008_TS, "Variable %qs at %L with " + && !gfc_notify_std (GFC_STD_F2018, "Variable %qs at %L with " "ALLOCATABLE attribute in procedure %qs " "with BIND(C)", sym->name, &(sym->declared_at), @@ -1409,7 +1409,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) retval = false; if (sym->attr.pointer == 1 - && !gfc_notify_std (GFC_STD_F2008_TS, "Variable %qs at %L with " + && !gfc_notify_std (GFC_STD_F2018, "Variable %qs at %L with " "POINTER attribute in procedure %qs " "with BIND(C)", sym->name, &(sym->declared_at), @@ -1434,7 +1434,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) retval = false; } else if (sym->attr.optional == 1 - && !gfc_notify_std (GFC_STD_F2008_TS, "Variable %qs " + && !gfc_notify_std (GFC_STD_F2018, "Variable %qs " "at %L with OPTIONAL attribute in " "procedure %qs which is BIND(C)", sym->name, &(sym->declared_at), @@ -1445,7 +1445,7 @@ gfc_verify_c_interop_param (gfc_symbol *sym) either assumed size or explicit shape. Deferred shape is already covered by the pointer/allocatable attribute. */ if (sym->as != NULL && sym->as->type == AS_ASSUMED_SHAPE - && !gfc_notify_std (GFC_STD_F2008_TS, "Assumed-shape array %qs " + && !gfc_notify_std (GFC_STD_F2018, "Assumed-shape array %qs " "at %L as dummy argument to the BIND(C) " "procedure %qs at %L", sym->name, &(sym->declared_at), @@ -3846,8 +3846,7 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int im gfc_error ("Assumed type at %C is not allowed for components"); return MATCH_ERROR; } - if (!gfc_notify_std (GFC_STD_F2008_TS, "Assumed type " - "at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "Assumed type at %C")) return MATCH_ERROR; ts->type = BT_ASSUMED; return MATCH_YES; Index: gcc/fortran/error.c =================================================================== --- gcc/fortran/error.c (revision 260433) +++ gcc/fortran/error.c (working copy) @@ -855,8 +855,6 @@ notify_std_msg(int std) return _("Fortran 2018 obsolescent feature:"); else if (std & GFC_STD_F2018) return _("Fortran 2018:"); - else if (std & GFC_STD_F2008_TS) - return "TS 29113/TS 18508:"; else if (std & GFC_STD_F2008_OBS) return _("Fortran 2008 obsolescent feature:"); else if (std & GFC_STD_F2008) Index: gcc/fortran/gfortran.texi =================================================================== --- gcc/fortran/gfortran.texi (revision 260433) +++ gcc/fortran/gfortran.texi (working copy) @@ -533,8 +533,7 @@ Specification @code{Further Interoperability of Fo (ISO/IEC TS 29113:2012). Full support of those standards and future Fortran standards is planned. The current status of the support is can be found in the @ref{Fortran 2003 status}, @ref{Fortran 2008 -status}, @ref{TS 29113 status}, @ref{TS 18508 status} and @ref{Fortran -2018 status} sections of the documentation. +status} and @ref{Fortran 2018 status} sections of the documentation. Additionally, the GNU Fortran compilers supports the OpenMP specification (version 4.0 and most of the features of the 4.5 version, @@ -793,8 +792,6 @@ compile option was used. @menu * Fortran 2003 status:: * Fortran 2008 status:: -* TS 29113 status:: -* TS 18508 status:: * Fortran 2018 status:: @end menu @@ -1096,9 +1093,30 @@ arrays are supported for named constants (@code{PA -@node TS 29113 status -@section Technical Specification 29113 Status +@node Fortran 2018 status +@section Status of Fortran 2018 support +So far very little work has been done to support Fortran 2018. + +@itemize +@item ERROR STOP in a PURE procedure +An @code{ERROR STOP} statement is permitted in a @code{PURE} +procedure. + +@item IMPLICIT NONE with a spec-list +Support the @code{IMPLICIT NONE} statement with an +@code{implicit-none-spec-list}. + +@item Behavior of INQUIRE with the RECL= specifier + +The behavior of the @code{INQUIRE} statement with the @code{RECL=} +specifier now conforms to Fortran 2018. + +@end itemize + + +@subsection TS 29113 Status (Further Interoperability with C) + GNU Fortran supports some of the new features of the Technical Specification (TS) 29113 on Further Interoperability of Fortran with C. The @uref{https://gcc.gnu.org/wiki/TS29113Status, wiki} has some information @@ -1108,8 +1126,6 @@ following is implemented. See also @ref{Further Interoperability of Fortran with C}. @itemize -@item The @option{-std=f2008ts} option. - @item The @code{OPTIONAL} attribute is allowed for dummy arguments of @code{BIND(C) procedures.} @@ -1125,9 +1141,9 @@ of the TS is not yet supported. @end itemize -@node TS 18508 status -@section Technical Specification 18508 Status +@subsection TS 18508 Status (Additional Parallel Features) + GNU Fortran supports the following new features of the Technical Specification 18508 on Additional Parallel Features in Fortran: @@ -1147,27 +1163,6 @@ polymorphic components. @end itemize -@node Fortran 2018 status -@section Status of Fortran 2018 support - -So far very little work has been done to support Fortran 2018. - -@itemize -@item ERROR STOP in a PURE procedure -An @code{ERROR STOP} statement is permitted in a @code{PURE} -procedure. - -@item IMPLICIT NONE with a spec-list -Support the @code{IMPLICIT NONE} statement with an -@code{implicit-none-spec-list}. - -@item Behavior of INQUIRE with the RECL= specifier - -The behavior of the @code{INQUIRE} statement with the @code{RECL=} -specifier now conforms to Fortran 2018. - -@end itemize - @c --------------------------------------------------------------------- @c Compiler Characteristics @c --------------------------------------------------------------------- Index: gcc/fortran/intrinsic.c =================================================================== --- gcc/fortran/intrinsic.c (revision 260433) +++ gcc/fortran/intrinsic.c (working copy) @@ -1849,7 +1849,7 @@ add_functions (void) mo, BT_UNKNOWN, 0, REQUIRED); add_sym_2 ("failed_images", GFC_ISYM_FAILED_IMAGES, CLASS_TRANSFORMATIONAL, - ACTUAL_NO, BT_INTEGER, dd, GFC_STD_F2008_TS, + ACTUAL_NO, BT_INTEGER, dd, GFC_STD_F2018, gfc_check_failed_or_stopped_images, gfc_simplify_failed_or_stopped_images, gfc_resolve_failed_images, team, BT_VOID, di, OPTIONAL, @@ -1947,7 +1947,7 @@ add_functions (void) make_generic ("getpid", GFC_ISYM_GETPID, GFC_STD_GNU); add_sym_1 ("get_team", GFC_ISYM_GET_TEAM, CLASS_TRANSFORMATIONAL, - ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2008_TS, + ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2018, gfc_check_get_team, NULL, gfc_resolve_get_team, level, BT_INTEGER, di, OPTIONAL); @@ -2102,7 +2102,7 @@ add_functions (void) ca, BT_REAL, dr, REQUIRED, sub, BT_INTEGER, ii, REQUIRED); add_sym_2 ("image_status", GFC_ISYM_IMAGE_STATUS, CLASS_ELEMENTAL, ACTUAL_NO, - BT_INTEGER, di, GFC_STD_F2008_TS, gfc_check_image_status, + BT_INTEGER, di, GFC_STD_F2018, gfc_check_image_status, gfc_simplify_image_status, gfc_resolve_image_status, image, BT_INTEGER, di, REQUIRED, team, BT_VOID, di, OPTIONAL); @@ -2715,9 +2715,9 @@ add_functions (void) make_generic ("range", GFC_ISYM_RANGE, GFC_STD_F95); add_sym_1 ("rank", GFC_ISYM_RANK, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, - GFC_STD_F2008_TS, gfc_check_rank, gfc_simplify_rank, gfc_resolve_rank, + GFC_STD_F2018, gfc_check_rank, gfc_simplify_rank, gfc_resolve_rank, a, BT_REAL, dr, REQUIRED); - make_generic ("rank", GFC_ISYM_RANK, GFC_STD_F2008_TS); + make_generic ("rank", GFC_ISYM_RANK, GFC_STD_F2018); add_sym_2 ("real", GFC_ISYM_REAL, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F77, gfc_check_real, gfc_simplify_real, gfc_resolve_real, @@ -3017,7 +3017,7 @@ add_functions (void) make_generic ("stat", GFC_ISYM_STAT, GFC_STD_GNU); add_sym_2 ("stopped_images", GFC_ISYM_STOPPED_IMAGES, CLASS_TRANSFORMATIONAL, - ACTUAL_NO, BT_INTEGER, dd, GFC_STD_F2008_TS, + ACTUAL_NO, BT_INTEGER, dd, GFC_STD_F2018, gfc_check_failed_or_stopped_images, gfc_simplify_failed_or_stopped_images, gfc_resolve_stopped_images, team, BT_VOID, di, OPTIONAL, @@ -3070,7 +3070,7 @@ add_functions (void) make_generic ("tanh", GFC_ISYM_TANH, GFC_STD_F77); add_sym_1 ("team_number", GFC_ISYM_TEAM_NUMBER, CLASS_TRANSFORMATIONAL, - ACTUAL_YES, BT_INTEGER, di, GFC_STD_F2008_TS, + ACTUAL_YES, BT_INTEGER, di, GFC_STD_F2018, gfc_check_team_number, NULL, gfc_resolve_team_number, team, BT_DERIVED, di, OPTIONAL); @@ -3344,7 +3344,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_5s ("atomic_cas", GFC_ISYM_ATOMIC_CAS, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_cas, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_INOUT, "old", BT_INTEGER, di, REQUIRED, INTENT_OUT, @@ -3353,7 +3353,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_3s ("atomic_add", GFC_ISYM_ATOMIC_ADD, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3360,7 +3360,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_3s ("atomic_and", GFC_ISYM_ATOMIC_AND, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3367,7 +3367,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_3s ("atomic_or", GFC_ISYM_ATOMIC_OR, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3374,7 +3374,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_3s ("atomic_xor", GFC_ISYM_ATOMIC_XOR, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3381,7 +3381,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_4s ("atomic_fetch_add", GFC_ISYM_ATOMIC_FETCH_ADD, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_fetch_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3389,7 +3389,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_4s ("atomic_fetch_and", GFC_ISYM_ATOMIC_FETCH_AND, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_fetch_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3397,7 +3397,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_4s ("atomic_fetch_or", GFC_ISYM_ATOMIC_FETCH_OR, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_fetch_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3405,7 +3405,7 @@ add_subroutines (void) stat, BT_INTEGER, di, OPTIONAL, INTENT_OUT); add_sym_4s ("atomic_fetch_xor", GFC_ISYM_ATOMIC_FETCH_XOR, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_atomic_fetch_op, NULL, NULL, "atom", BT_INTEGER, di, REQUIRED, INTENT_OUT, "value", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3419,7 +3419,7 @@ add_subroutines (void) tm, BT_REAL, dr, REQUIRED, INTENT_OUT); add_sym_3s ("event_query", GFC_ISYM_EVENT_QUERY, CLASS_ATOMIC, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_event_query, NULL, gfc_resolve_event_query, "event", BT_INTEGER, di, REQUIRED, INTENT_IN, c, BT_INTEGER, di, OPTIONAL, INTENT_IN, @@ -3609,7 +3609,7 @@ add_subroutines (void) /* Coarray collectives. */ add_sym_4s ("co_broadcast", GFC_ISYM_CO_BROADCAST, CLASS_IMPURE, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_co_broadcast, NULL, NULL, a, BT_REAL, dr, REQUIRED, INTENT_INOUT, "source_image", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -3617,7 +3617,7 @@ add_subroutines (void) errmsg, BT_CHARACTER, dc, OPTIONAL, INTENT_OUT); add_sym_4s ("co_max", GFC_ISYM_CO_MAX, CLASS_IMPURE, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_co_minmax, NULL, NULL, a, BT_REAL, dr, REQUIRED, INTENT_INOUT, result_image, BT_INTEGER, di, OPTIONAL, INTENT_IN, @@ -3625,7 +3625,7 @@ add_subroutines (void) errmsg, BT_CHARACTER, dc, OPTIONAL, INTENT_OUT); add_sym_4s ("co_min", GFC_ISYM_CO_MIN, CLASS_IMPURE, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_co_minmax, NULL, NULL, a, BT_REAL, dr, REQUIRED, INTENT_INOUT, result_image, BT_INTEGER, di, OPTIONAL, INTENT_IN, @@ -3633,7 +3633,7 @@ add_subroutines (void) errmsg, BT_CHARACTER, dc, OPTIONAL, INTENT_OUT); add_sym_4s ("co_sum", GFC_ISYM_CO_SUM, CLASS_IMPURE, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_co_sum, NULL, NULL, a, BT_REAL, dr, REQUIRED, INTENT_INOUT, result_image, BT_INTEGER, di, OPTIONAL, INTENT_IN, @@ -3641,7 +3641,7 @@ add_subroutines (void) errmsg, BT_CHARACTER, dc, OPTIONAL, INTENT_OUT); add_sym_5s ("co_reduce", GFC_ISYM_CO_REDUCE, CLASS_IMPURE, - BT_UNKNOWN, 0, GFC_STD_F2008_TS, + BT_UNKNOWN, 0, GFC_STD_F2018, gfc_check_co_reduce, NULL, NULL, a, BT_REAL, dr, REQUIRED, INTENT_INOUT, "operator", BT_INTEGER, di, REQUIRED, INTENT_IN, @@ -4618,8 +4618,8 @@ gfc_check_intrinsic_standard (const gfc_intrinsic_ symstd_msg = "new in Fortran 2008"; break; - case GFC_STD_F2008_TS: - symstd_msg = "new in TS 29113/TS 18508"; + case GFC_STD_F2018: + symstd_msg = "new in Fortran 2018"; break; case GFC_STD_GNU: Index: gcc/fortran/invoke.texi =================================================================== --- gcc/fortran/invoke.texi (revision 260433) +++ gcc/fortran/invoke.texi (working copy) @@ -481,10 +481,9 @@ conformance to the Fortran 95, Fortran 2003, Fortr 2018 standards, respectively; errors are given for all extensions beyond the relevant language standard, and warnings are given for the Fortran 77 features that are permitted but obsolescent in later -standards. @samp{-std=f2008ts} allows the Fortran 2008 standard -including the additions of the Technical Specification (TS) 29113 on -Further Interoperability of Fortran with C and TS 18508 on Additional -Parallel Features in Fortran. +standards. The deprecated option @samp{-std=f2008ts} acts as an alias for +@samp{-std=f2018}. It is only present for backwards compatibility with +earlier gfortran versions and should not be used any more. @item -ftest-forall-temp @opindex @code{ftest-forall-temp} @@ -994,7 +993,7 @@ of the Fortran Character Set. For continuation li by a digit between 1 and 9 is supported. @option{-Wtabs} will cause a warning to be issued if a tab is encountered. Note, @option{-Wtabs} is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003}, -@option{-std=f2008}, @option{-std=f2008ts}, @option{-std=f2018} and +@option{-std=f2008}, @option{-std=f2018} and @option{-Wall}. @item -Wundefined-do-loop Index: gcc/fortran/iso-c-binding.def =================================================================== --- gcc/fortran/iso-c-binding.def (revision 260433) +++ gcc/fortran/iso-c-binding.def (working copy) @@ -66,7 +66,7 @@ NAMED_INTCST (ISOCBINDING_INTMAX_T, "c_intmax_t", NAMED_INTCST (ISOCBINDING_INTPTR_T, "c_intptr_t", \ get_int_kind_from_name (INTPTR_TYPE), GFC_STD_F2003) NAMED_INTCST (ISOCBINDING_PTRDIFF_T, "c_ptrdiff_t", \ - get_int_kind_from_name (PTRDIFF_TYPE), GFC_STD_F2008_TS) + get_int_kind_from_name (PTRDIFF_TYPE), GFC_STD_F2018) NAMED_INTCST (ISOCBINDING_SIZE_T, "c_size_t", \ gfc_index_integer_kind, GFC_STD_F2003) NAMED_INTCST (ISOCBINDING_SIGNED_CHAR, "c_signed_char", \ Index: gcc/fortran/iso-fortran-env.def =================================================================== --- gcc/fortran/iso-fortran-env.def (revision 260433) +++ gcc/fortran/iso-fortran-env.def (working copy) @@ -86,7 +86,7 @@ NAMED_INTCST (ISOFORTRANENV_FILE_STAT_LOCKED_OTHER NAMED_INTCST (ISOFORTRANENV_FILE_STAT_STOPPED_IMAGE, "stat_stopped_image", \ GFC_STAT_STOPPED_IMAGE, GFC_STD_F2008) NAMED_INTCST (ISOFORTRANENV_FILE_STAT_FAILED_IMAGE, "stat_failed_image", \ - GFC_STAT_FAILED_IMAGE, GFC_STD_F2008_TS) + GFC_STAT_FAILED_IMAGE, GFC_STD_F2018) NAMED_INTCST (ISOFORTRANENV_FILE_STAT_UNLOCKED, "stat_unlocked", \ GFC_STAT_UNLOCKED, GFC_STD_F2008) @@ -126,12 +126,12 @@ NAMED_DERIVED_TYPE (ISOFORTRAN_LOCK_TYPE, "lock_ty NAMED_DERIVED_TYPE (ISOFORTRAN_EVENT_TYPE, "event_type", \ flag_coarray == GFC_FCOARRAY_LIB ? get_int_kind_from_node (ptr_type_node) - : gfc_default_integer_kind, GFC_STD_F2008_TS) + : gfc_default_integer_kind, GFC_STD_F2018) NAMED_DERIVED_TYPE (ISOFORTRAN_TEAM_TYPE, "team_type", \ flag_coarray == GFC_FCOARRAY_LIB ? get_int_kind_from_node (ptr_type_node) - : gfc_default_integer_kind, GFC_STD_F2008_TS) + : gfc_default_integer_kind, GFC_STD_F2018) #undef NAMED_INTCST #undef NAMED_KINDARRAY Index: gcc/fortran/libgfortran.h =================================================================== --- gcc/fortran/libgfortran.h (revision 260433) +++ gcc/fortran/libgfortran.h (working copy) @@ -22,10 +22,9 @@ along with GCC; see the file COPYING3. If not see Note that no features were obsoleted nor deleted in F2003. Please remember to keep those definitions in sync with gfortran.texi. */ -#define GFC_STD_F2018_DEL (1<<12) /* Deleted in F2018. */ -#define GFC_STD_F2018_OBS (1<<11) /* Obsolescent in F2018. */ -#define GFC_STD_F2018 (1<<10) /* New in F2018. */ -#define GFC_STD_F2008_TS (1<<9) /* POST-F2008 technical reports. */ +#define GFC_STD_F2018_DEL (1<<11) /* Deleted in F2018. */ +#define GFC_STD_F2018_OBS (1<<10) /* Obsolescent in F2018. */ +#define GFC_STD_F2018 (1<<9) /* New in F2018. */ #define GFC_STD_F2008_OBS (1<<8) /* Obsolescent in F2008. */ #define GFC_STD_F2008 (1<<7) /* New in F2008. */ #define GFC_STD_LEGACY (1<<6) /* Backward compatibility. */ @@ -44,8 +43,7 @@ along with GCC; see the file COPYING3. If not see | GFC_STD_F2018_DEL) #define GFC_STD_OPT_F03 (GFC_STD_OPT_F95 | GFC_STD_F2003) #define GFC_STD_OPT_F08 (GFC_STD_OPT_F03 | GFC_STD_F2008) -#define GFC_STD_OPT_F08TS (GFC_STD_OPT_F08 | GFC_STD_F2008_TS) -#define GFC_STD_OPT_F18 ((GFC_STD_OPT_F08TS | GFC_STD_F2018) \ +#define GFC_STD_OPT_F18 ((GFC_STD_OPT_F08 | GFC_STD_F2018) \ & (~GFC_STD_F2018_DEL)) /* Bitmasks for the various FPE that can be enabled. These need to be straight integers Index: gcc/fortran/match.c =================================================================== --- gcc/fortran/match.c (revision 260433) +++ gcc/fortran/match.c (working copy) @@ -3322,7 +3322,7 @@ cleanup: match gfc_match_event_post (void) { - if (!gfc_notify_std (GFC_STD_F2008_TS, "EVENT POST statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "EVENT POST statement at %C")) return MATCH_ERROR; return event_statement (ST_EVENT_POST); @@ -3332,7 +3332,7 @@ gfc_match_event_post (void) match gfc_match_event_wait (void) { - if (!gfc_notify_std (GFC_STD_F2008_TS, "EVENT WAIT statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "EVENT WAIT statement at %C")) return MATCH_ERROR; return event_statement (ST_EVENT_WAIT); @@ -3344,7 +3344,7 @@ gfc_match_event_wait (void) match gfc_match_fail_image (void) { - if (!gfc_notify_std (GFC_STD_F2008_TS, "FAIL IMAGE statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "FAIL IMAGE statement at %C")) return MATCH_ERROR; if (gfc_match_char ('(') == MATCH_YES) @@ -3368,7 +3368,7 @@ gfc_match_form_team (void) match m; gfc_expr *teamid,*team; - if (!gfc_notify_std (GFC_STD_F2008_TS, "FORM TEAM statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "FORM TEAM statement at %C")) return MATCH_ERROR; if (gfc_match_char ('(') == MATCH_NO) @@ -3407,7 +3407,7 @@ gfc_match_change_team (void) match m; gfc_expr *team; - if (!gfc_notify_std (GFC_STD_F2008_TS, "CHANGE TEAM statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "CHANGE TEAM statement at %C")) return MATCH_ERROR; if (gfc_match_char ('(') == MATCH_NO) @@ -3437,7 +3437,7 @@ syntax: match gfc_match_end_team (void) { - if (!gfc_notify_std (GFC_STD_F2008_TS, "END TEAM statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "END TEAM statement at %C")) return MATCH_ERROR; if (gfc_match_char ('(') == MATCH_YES) @@ -3461,7 +3461,7 @@ gfc_match_sync_team (void) match m; gfc_expr *team; - if (!gfc_notify_std (GFC_STD_F2008_TS, "SYNC TEAM statement at %C")) + if (!gfc_notify_std (GFC_STD_F2018, "SYNC TEAM statement at %C")) return MATCH_ERROR; if (gfc_match_char ('(') == MATCH_NO) Index: gcc/fortran/options.c =================================================================== --- gcc/fortran/options.c (revision 260433) +++ gcc/fortran/options.c (working copy) @@ -42,7 +42,7 @@ set_default_std_flags (void) { gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY + | GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS; gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY; } @@ -731,13 +731,6 @@ gfc_handle_option (size_t scode, const char *arg, break; case OPT_std_f2008ts: - gfc_option.allow_std = GFC_STD_OPT_F08TS; - gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; - gfc_option.max_identifier_length = 63; - warn_ampersand = 1; - warn_tabs = 1; - break; - case OPT_std_f2018: gfc_option.allow_std = GFC_STD_OPT_F18; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS Index: gcc/testsuite/gfortran.dg/assumed_rank_5.f90 =================================================================== --- gcc/testsuite/gfortran.dg/assumed_rank_5.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/assumed_rank_5.f90 (working copy) @@ -5,5 +5,5 @@ ! ! subroutine foo(x) - integer :: x(..) ! { dg-error "TS 29113/TS 18508: Assumed-rank array" } + integer :: x(..) ! { dg-error "Fortran 2018: Assumed-rank array" } end subroutine foo Index: gcc/testsuite/gfortran.dg/assumed_type_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/assumed_type_4.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/assumed_type_4.f90 (working copy) @@ -6,5 +6,5 @@ ! Test TYPE(*) subroutine one(a) - type(*) :: a ! { dg-error "TS 29113/TS 18508: Assumed type" } + type(*) :: a ! { dg-error "Fortran 2018: Assumed type" } end subroutine one Index: gcc/testsuite/gfortran.dg/bind_c_array_params.f03 =================================================================== --- gcc/testsuite/gfortran.dg/bind_c_array_params.f03 (revision 260433) +++ gcc/testsuite/gfortran.dg/bind_c_array_params.f03 (working copy) @@ -5,11 +5,11 @@ use, intrinsic :: iso_c_binding implicit none contains - subroutine sub0(assumed_array) bind(c) ! { dg-error "TS 29113/TS 18508: Assumed-shape array 'assumed_array' at .1. as dummy argument to the BIND.C. procedure 'sub0'" } + subroutine sub0(assumed_array) bind(c) ! { dg-error "Fortran 2018: Assumed-shape array 'assumed_array' at .1. as dummy argument to the BIND.C. procedure 'sub0'" } integer(c_int), dimension(:) :: assumed_array end subroutine sub0 - subroutine sub1(deferred_array) bind(c) ! { dg-error "TS 29113/TS 18508: Variable 'deferred_array' at .1. with POINTER attribute in procedure 'sub1' with BIND.C." } + subroutine sub1(deferred_array) bind(c) ! { dg-error "Fortran 2018: Variable 'deferred_array' at .1. with POINTER attribute in procedure 'sub1' with BIND.C." } integer(c_int), pointer :: deferred_array(:) end subroutine sub1 end module bind_c_array_params Index: gcc/testsuite/gfortran.dg/bind_c_usage_28.f90 =================================================================== --- gcc/testsuite/gfortran.dg/bind_c_usage_28.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/bind_c_usage_28.f90 (working copy) @@ -8,11 +8,11 @@ type, bind(C) :: cstruct integer :: i end type interface - subroutine psub(this) bind(c, name='Psub') ! { dg-error "TS 29113/TS 18508: Variable 'this' at .1. with POINTER attribute in procedure 'psub' with BIND.C." } + subroutine psub(this) bind(c, name='Psub') ! { dg-error "Fortran 2018: Variable 'this' at .1. with POINTER attribute in procedure 'psub' with BIND.C." } import :: c_float, cstruct real(c_float), pointer :: this(:) end subroutine psub - subroutine psub2(that) bind(c, name='Psub2') ! { dg-error "TS 29113/TS 18508: Variable 'that' at .1. with ALLOCATABLE attribute in procedure 'psub2' with BIND.C." } + subroutine psub2(that) bind(c, name='Psub2') ! { dg-error "Fortran 2018: Variable 'that' at .1. with ALLOCATABLE attribute in procedure 'psub2' with BIND.C." } import :: c_float, cstruct type(cstruct), allocatable :: that(:) end subroutine psub2 Index: gcc/testsuite/gfortran.dg/c_funloc_tests_5.f03 =================================================================== --- gcc/testsuite/gfortran.dg/c_funloc_tests_5.f03 (revision 260433) +++ gcc/testsuite/gfortran.dg/c_funloc_tests_5.f03 (working copy) @@ -8,9 +8,9 @@ contains subroutine sub0() bind(c) type(c_funptr) :: my_c_funptr - my_c_funptr = c_funloc(sub1) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure at .1. to C_FUNLOC" } + my_c_funptr = c_funloc(sub1) ! { dg-error "Fortran 2018: Noninteroperable procedure at .1. to C_FUNLOC" } - my_c_funptr = c_funloc(func0) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure at .1. to C_FUNLOC" } + my_c_funptr = c_funloc(func0) ! { dg-error "Fortran 2018: Noninteroperable procedure at .1. to C_FUNLOC" } end subroutine sub0 subroutine sub1() Index: gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 =================================================================== --- gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/c_funloc_tests_6.f90 (working copy) @@ -26,6 +26,6 @@ cfp = c_loc (int) ! { dg-error "Can't convert TY call c_f_pointer (cfp, int) ! { dg-error "Argument CPTR at .1. to C_F_POINTER shall have the type TYPE.C_PTR." } call c_f_procpointer (cp, fsub) ! { dg-error "Argument CPTR at .1. to C_F_PROCPOINTER shall have the type TYPE.C_FUNPTR." } -cfp = c_funloc (noCsub) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure at .1. to C_FUNLOC" } -call c_f_procpointer (cfp, fint) ! { dg-error "TS 29113/TS 18508: Noninteroperable procedure pointer at .1. to C_F_PROCPOINTER" } +cfp = c_funloc (noCsub) ! { dg-error "Fortran 2018: Noninteroperable procedure at .1. to C_FUNLOC" } +call c_f_procpointer (cfp, fint) ! { dg-error "Fortran 2018: Noninteroperable procedure pointer at .1. to C_F_PROCPOINTER" } end Index: gcc/testsuite/gfortran.dg/c_loc_tests_11.f03 =================================================================== --- gcc/testsuite/gfortran.dg/c_loc_tests_11.f03 (revision 260433) +++ gcc/testsuite/gfortran.dg/c_loc_tests_11.f03 (working copy) @@ -43,7 +43,7 @@ contains integer(c_int), intent(in) :: handle get_foo_address = c_loc(foo_pool(handle)%v) - get_foo_address = c_loc(foo_pool2(handle)%v) ! { dg-error "TS 29113/TS 18508: Noninteroperable array at .1. as argument to C_LOC: Expression is a noninteroperable derived type" } + get_foo_address = c_loc(foo_pool2(handle)%v) ! { dg-error "Fortran 2018: Noninteroperable array at .1. as argument to C_LOC: Expression is a noninteroperable derived type" } end function get_foo_address Index: gcc/testsuite/gfortran.dg/coarray_atomic_2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_atomic_2.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/coarray_atomic_2.f90 (working copy) @@ -6,15 +6,15 @@ implicit none intrinsic :: atomic_define intrinsic :: atomic_ref -intrinsic :: atomic_cas ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_add ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_and ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_or ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_xor ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_fetch_add ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_fetch_and ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_fetch_or ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } -intrinsic :: atomic_fetch_xor ! { dg-error "not available in the current standard settings but new in TS 29113/TS 18508." } +intrinsic :: atomic_cas ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_add ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_and ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_or ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_xor ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_fetch_add ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_fetch_and ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_fetch_or ! { dg-error "not available in the current standard settings but new in Fortran 2018." } +intrinsic :: atomic_fetch_xor ! { dg-error "not available in the current standard settings but new in Fortran 2018." } integer(atomic_int_kind) :: caf[*], var logical(atomic_logical_kind) :: caf_log[*], var2 integer :: stat Index: gcc/testsuite/gfortran.dg/coarray_collectives_10.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_collectives_10.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/coarray_collectives_10.f90 (working copy) @@ -6,6 +6,6 @@ ! program test implicit none - intrinsic co_reduce ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } - intrinsic co_broadcast ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } + intrinsic co_reduce ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } + intrinsic co_broadcast ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } end program test Index: gcc/testsuite/gfortran.dg/coarray_collectives_13.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_collectives_13.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/coarray_collectives_13.f90 (working copy) @@ -6,6 +6,6 @@ ! program test implicit none - intrinsic co_reduce ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } - intrinsic co_broadcast ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } + intrinsic co_reduce ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } + intrinsic co_broadcast ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } end program test Index: gcc/testsuite/gfortran.dg/coarray_collectives_2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/coarray_collectives_2.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/coarray_collectives_2.f90 (working copy) @@ -6,7 +6,7 @@ ! program test implicit none - intrinsic co_max ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } - intrinsic co_min ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } - intrinsic co_sum ! { dg-error "is not available in the current standard settings but new in TS 29113/TS 18508." } + intrinsic co_max ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } + intrinsic co_min ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } + intrinsic co_sum ! { dg-error "is not available in the current standard settings but new in Fortran 2018." } end program test Index: gcc/testsuite/gfortran.dg/error_stop_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/error_stop_4.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/error_stop_4.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-std=f2008ts" } +! { dg-options "-std=f2008" } ! ! F2018 permits ERROR STOP in PURE procedures ! Index: gcc/testsuite/gfortran.dg/implicit_14.f90 =================================================================== --- gcc/testsuite/gfortran.dg/implicit_14.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/implicit_14.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-std=f2008ts" } +! { dg-options "-std=f2008" } ! ! Support Fortran 2018's IMPLICIT NONE with spec list ! (currently implemented as vendor extension) Index: gcc/testsuite/gfortran.dg/rank_3.f90 =================================================================== --- gcc/testsuite/gfortran.dg/rank_3.f90 (revision 260433) +++ gcc/testsuite/gfortran.dg/rank_3.f90 (working copy) @@ -3,5 +3,5 @@ ! ! PR fortran/48820 ! -intrinsic :: rank ! { dg-error "new in TS 29113" } +intrinsic :: rank ! { dg-error "new in Fortran 2018" } end
On Mon, May 21, 2018 at 12:00 AM, Janus Weil <janus@gcc.gnu.org> wrote: > > Thanks. I have committed this version of the patch as r260433. This caused: FAIL: gfortran.dg/graphite/block-2.f -O (test for excess errors) FAIL: gfortran.dg/graphite/id-19.f -O (test for excess errors) FAIL: gfortran.dg/graphite/id-20.f -O (test for excess errors) FAIL: gfortran.dg/graphite/id-27.f90 -O (test for excess errors) FAIL: gfortran.dg/graphite/pr82449.f -O (test for excess errors) FAIL: gfortran.dg/pr30667.f -O (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/collapse2.f90 -Os (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/omp_atomic2.f90 -Os (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/omp_parse1.f90 -Os (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/omp_parse3.f90 -Os (test for excess errors) FAIL: libgomp.fortran/task2.f90 -O (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla1.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla2.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla3.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla4.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla5.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla6.f90 -Os (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -O0 (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -O1 (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -O2 (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -O3 -g (test for excess errors) FAIL: libgomp.fortran/vla8.f90 -Os (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O0 (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O1 (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O2 (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O3 -g (test for excess errors) FAIL: libgomp.oacc-fortran/collapse-2.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -Os (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O0 (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O1 (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O2 (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -O3 -g (test for excess errors) FAIL: libgomp.oacc-fortran/nested-function-1.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -Os (test for excess errors) on i686 and x86-64. /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gfortran.dg/graphite/pr82449.f:10:72: Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 40 at (1)^M FAIL: gfortran.dg/graphite/pr82449.f -O (test for excess errors) H.J.
On Mon, May 21, 2018 at 12:14:13PM +0200, Janus Weil wrote: > > So, here is the promised follow-up patch. It mostly removes > GFC_STD_F2008_TS and replaces it by GFC_STD_F2018 in a mechanical > manner. Plus, it fixes the resulting fallout in the testsuite and > updates the documentation. The non-mechanical parts are libgfortran.h > and options.c. Regtests cleanly. Ok for trunk with a suitable > ChangeLog? Looks good to me. HJ Lu posted of list of failures https://gcc.gnu.org/ml/fortran/2018-05/msg00067.html Can you cast an eye over the failures? I suspect these can be fixed by adding { dg-options -std=f2008 } or similar.
On Mon, May 21, 2018 at 09:00:58AM +0200, Janus Weil wrote: > 2018-05-21 0:19 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: > > On Sun, May 20, 2018 at 09:44:47PM +0200, Janus Weil wrote: > >> > >> >> The patch still regtests cleanly. Ok for trunk? > >> > > >> > Patch looks good to me. The only thing that worries me is > >> > whether the patch will cause the SPEC benchmark to throw > >> > an error or warning that it did not before. As I don't have > >> > SPEC benchmark and it cost $$$, I'm not going to let it > >> > bother too much. > >> > >> Unfortunately I don't have access to SPEC either. Is anyone in a > >> position to check this? > > > > We'll find out evidently as one of the C/C++ developers run SPEC. > > Ok, we have plenty of time to fix up things before the next release anyway. > Janus, The attached patch fixes a few testcases that were missed in the original patch. Do you have these already in an updated patch, or would you like me to commit my patch?
Hi Steve, > The attached patch fixes a few testcases that were missed > in the original patch. Do you have these already in an > updated patch, or would you like me to commit my patch? I saw the message just now and had no time to react yet. Please feel free to commit your patch. Thanks, Janus
On Mon, May 21, 2018 at 09:06:40PM +0200, Janus Weil wrote: > Hi Steve, > > > The attached patch fixes a few testcases that were missed > > in the original patch. Do you have these already in an > > updated patch, or would you like me to commit my patch? > > I saw the message just now and had no time to react yet. Please feel > free to commit your patch. > OK, I'll commit with an appropriate ChangeLog in a few minutes.
On Mon, May 21, 2018 at 12:10:01PM -0700, Steve Kargl wrote: > On Mon, May 21, 2018 at 09:06:40PM +0200, Janus Weil wrote: > > Hi Steve, > > > > > The attached patch fixes a few testcases that were missed > > > in the original patch. Do you have these already in an > > > updated patch, or would you like me to commit my patch? > > > > I saw the message just now and had no time to react yet. Please feel > > free to commit your patch. > > > > OK, I'll commit with an appropriate ChangeLog in a few minutes. > Done.
2018-05-21 21:23 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: > On Mon, May 21, 2018 at 12:10:01PM -0700, Steve Kargl wrote: >> On Mon, May 21, 2018 at 09:06:40PM +0200, Janus Weil wrote: >> > Hi Steve, >> > >> > > The attached patch fixes a few testcases that were missed >> > > in the original patch. Do you have these already in an >> > > updated patch, or would you like me to commit my patch? >> > >> > I saw the message just now and had no time to react yet. Please feel >> > free to commit your patch. >> > >> >> OK, I'll commit with an appropriate ChangeLog in a few minutes. >> > > Done. Thank you! I wonder why I did not see the gfortran.dg/graphite failures. My testsuite log looks like those should have been run: Running /home/jweil/gcc/trunk/gcc/testsuite/gfortran.dg/graphite/graphite.exp ... Running /home/jweil/gcc/trunk/gcc/testsuite/gfortran.dg/graphite/graphite.exp ... Running /home/jweil/gcc/trunk/gcc/testsuite/gfortran.dg/graphite/graphite.exp ... Running /home/jweil/gcc/trunk/gcc/testsuite/gfortran.dg/graphite/graphite.exp ... However no failures were reported! Regarding the libgomp.fortran cases: Those are not included in "make check-fortran", right? How do I actually run them? Is this documented somewhere? Cheers, Janus
On Mon, May 21, 2018 at 09:39:29PM +0200, Janus Weil wrote: > > Regarding the libgomp.fortran cases: Those are not included in "make > check-fortran", right? How do I actually run them? Is this documented > somewhere? Good question! When I want to do a specific check, I do something of the form % gmake check-fortran RUNTESTFLAGS="dg.exp=\*alloc\*.f90" which runs all tests with 'alloc' in the file name. I don't know the magic incantation for libgomp.fortran short of a full on 'gmake check'.
On Mon, May 21, 2018 at 1:06 PM, Steve Kargl <sgk@troutmask.apl.washington.edu> wrote: > On Mon, May 21, 2018 at 09:39:29PM +0200, Janus Weil wrote: >> >> Regarding the libgomp.fortran cases: Those are not included in "make >> check-fortran", right? How do I actually run them? Is this documented >> somewhere? > > Good question! > > When I want to do a specific check, I do something of the form > > % gmake check-fortran RUNTESTFLAGS="dg.exp=\*alloc\*.f90" > > which runs all tests with 'alloc' in the file name. I don't > know the magic incantation for libgomp.fortran short of a > full on 'gmake check'. > They are under target/libgomp.
On Mon, May 21, 2018 at 01:06:21PM -0700, Steve Kargl wrote: > On Mon, May 21, 2018 at 09:39:29PM +0200, Janus Weil wrote: > > > > Regarding the libgomp.fortran cases: Those are not included in "make > > check-fortran", right? How do I actually run them? Is this documented > > somewhere? > > Good question! > > When I want to do a specific check, I do something of the form > > % gmake check-fortran RUNTESTFLAGS="dg.exp=\*alloc\*.f90" > > which runs all tests with 'alloc' in the file name. I don't > know the magic incantation for libgomp.fortran short of a > full on 'gmake check'. E.g. in toplevel directory do make check-target-libgomp RUNTESTFLAGS=fortran.exp Jakub
2018-05-21 22:16 GMT+02:00 Jakub Jelinek <jakub@redhat.com>: > On Mon, May 21, 2018 at 01:06:21PM -0700, Steve Kargl wrote: >> On Mon, May 21, 2018 at 09:39:29PM +0200, Janus Weil wrote: >> > >> > Regarding the libgomp.fortran cases: Those are not included in "make >> > check-fortran", right? How do I actually run them? Is this documented >> > somewhere? >> >> Good question! >> >> When I want to do a specific check, I do something of the form >> >> % gmake check-fortran RUNTESTFLAGS="dg.exp=\*alloc\*.f90" >> >> which runs all tests with 'alloc' in the file name. I don't >> know the magic incantation for libgomp.fortran short of a >> full on 'gmake check'. > > E.g. in toplevel directory do > make check-target-libgomp RUNTESTFLAGS=fortran.exp Thanks! I'll take care of fixing the remaining libgomp failures. Sorry again for the breakage, Janus
2018-05-21 22:18 GMT+02:00 Janus Weil <janus@gcc.gnu.org>:
> I'll take care of fixing the remaining libgomp failures.
Should be done with r260487. Please let me know if you observe any
additional problems.
Cheers,
Janus
2018-05-21 18:57 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: > On Mon, May 21, 2018 at 12:14:13PM +0200, Janus Weil wrote: >> >> So, here is the promised follow-up patch. It mostly removes >> GFC_STD_F2008_TS and replaces it by GFC_STD_F2018 in a mechanical >> manner. Plus, it fixes the resulting fallout in the testsuite and >> updates the documentation. The non-mechanical parts are libgfortran.h >> and options.c. Regtests cleanly. Ok for trunk with a suitable >> ChangeLog? > > Looks good to me. I have now also committed this follow-up as r260499 (after checking that not only the gfortran testsuite is regression-free, but also the Fortran part of the libgomp testsuite). Cheers, Janus
On Mon, May 21, 2018 at 10:47 PM, Janus Weil <janus@gcc.gnu.org> wrote: > 2018-05-21 18:57 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: >> On Mon, May 21, 2018 at 12:14:13PM +0200, Janus Weil wrote: >>> >>> So, here is the promised follow-up patch. It mostly removes >>> GFC_STD_F2008_TS and replaces it by GFC_STD_F2018 in a mechanical >>> manner. Plus, it fixes the resulting fallout in the testsuite and >>> updates the documentation. The non-mechanical parts are libgfortran.h >>> and options.c. Regtests cleanly. Ok for trunk with a suitable >>> ChangeLog? >> >> Looks good to me. > > I have now also committed this follow-up as r260499 (after checking > that not only the gfortran testsuite is regression-free, but also the > Fortran part of the libgomp testsuite). > Another one: /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr30667.f:9:72: Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)^M FAIL: gfortran.dg/pr30667.f -O (test for excess errors) Excess errors: /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr30667.f:9:72: Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)
2018-05-22 20:56 GMT+02:00 H.J. Lu <hjl.tools@gmail.com>: > On Mon, May 21, 2018 at 10:47 PM, Janus Weil <janus@gcc.gnu.org> wrote: >> 2018-05-21 18:57 GMT+02:00 Steve Kargl <sgk@troutmask.apl.washington.edu>: >>> On Mon, May 21, 2018 at 12:14:13PM +0200, Janus Weil wrote: >>>> >>>> So, here is the promised follow-up patch. It mostly removes >>>> GFC_STD_F2008_TS and replaces it by GFC_STD_F2018 in a mechanical >>>> manner. Plus, it fixes the resulting fallout in the testsuite and >>>> updates the documentation. The non-mechanical parts are libgfortran.h >>>> and options.c. Regtests cleanly. Ok for trunk with a suitable >>>> ChangeLog? >>> >>> Looks good to me. >> >> I have now also committed this follow-up as r260499 (after checking >> that not only the gfortran testsuite is regression-free, but also the >> Fortran part of the libgomp testsuite). >> > > Another one: > > /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr30667.f:9:72: > Warning: Fortran 2018 deleted feature: DO termination statement which > is not END DO or CONTINUE with label 100 at (1)^M > FAIL: gfortran.dg/pr30667.f -O (test for excess errors) > Excess errors: > /export/gnu/import/git/sources/gcc/gcc/testsuite/gfortran.dg/pr30667.f:9:72: > Warning: Fortran 2018 deleted feature: DO termination statement which > is not END DO or CONTINUE with label 100 at (1) I added "-std=legacy" for this case in r260555, which should fix it. Cheers, Janus
Index: gcc/fortran/match.c =================================================================== --- gcc/fortran/match.c (revision 260402) +++ gcc/fortran/match.c (working copy) @@ -1442,6 +1442,8 @@ match_arithmetic_if (void) return MATCH_ERROR; } + if (!gfc_notify_std (GFC_STD_F2018_DEL, "Arithmetic IF statement at %C")) + return MATCH_ERROR; if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) return MATCH_ERROR; @@ -1522,6 +1524,8 @@ gfc_match_if (gfc_statement *if_type) return MATCH_ERROR; } + if (!gfc_notify_std (GFC_STD_F2018_DEL, "Arithmetic IF statement at %C")) + return MATCH_ERROR; if (!gfc_notify_std (GFC_STD_F95_OBS, "Arithmetic IF statement at %C")) return MATCH_ERROR; @@ -2939,11 +2943,12 @@ gfc_match_stopcode (gfc_statement st) /* Set f95 for -std=f95. */ f95 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS); + | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL); /* Set f03 for -std=f2003. */ f03 = gfc_option.allow_std == (GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS | GFC_STD_F2003); + | GFC_STD_F2008_OBS | GFC_STD_F2003 + | GFC_STD_F2018_DEL); /* Look for a blank between STOP and the stop-code for F2008 or later. */ if (gfc_current_form != FORM_FIXED && !(f95 || f03)) Index: gcc/fortran/options.c =================================================================== --- gcc/fortran/options.c (revision 260402) +++ gcc/fortran/options.c (working copy) @@ -44,7 +44,7 @@ set_default_std_flags (void) | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS; - gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY; + gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY; } @@ -706,7 +706,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f95: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95 | GFC_STD_F77 - | GFC_STD_F2008_OBS; + | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_continue_fixed = 19; gfc_option.max_continue_free = 39; @@ -717,7 +717,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2003: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS; + | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008_OBS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -726,7 +726,8 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2008: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 - | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS; + | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS + | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; @@ -736,7 +737,7 @@ gfc_handle_option (size_t scode, const char *arg, case OPT_std_f2008ts: gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77 | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS - | GFC_STD_F2008_TS; + | GFC_STD_F2008_TS | GFC_STD_F2018_DEL; gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS; gfc_option.max_identifier_length = 63; warn_ampersand = 1; Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (revision 260402) +++ gcc/fortran/symbol.c (working copy) @@ -2721,9 +2721,14 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type lp->defined = type; if (lp->referenced == ST_LABEL_DO_TARGET && type != ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement " - "which is not END DO or CONTINUE with " - "label %d at %C", labelno)) + && (!gfc_notify_std (GFC_STD_F2018_DEL, + "DO termination statement which is not " + "END DO or CONTINUE with label %d at %C", + labelno) || + !gfc_notify_std (GFC_STD_F95_OBS, + "DO termination statement which is not " + "END DO or CONTINUE with label %d at %C", + labelno))) return; break; @@ -2778,8 +2783,10 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_t } if (lp->referenced == ST_LABEL_DO_TARGET && type == ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d " - "at %C", labelno)) + && (!gfc_notify_std (GFC_STD_F2018_DEL, "Shared DO termination label %d " + "at %C", labelno) || + !gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d " + "at %C", labelno))) return false; if (lp->referenced != ST_LABEL_DO_TARGET) Index: gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (revision 260402) +++ gcc/testsuite/gfortran.dg/goacc/loop-1-2.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1.f95. +! { dg-additional-options "-std=legacy" } program test call test1 @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/goacc/loop-1.f95 =================================================================== --- gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (revision 260402) +++ gcc/testsuite/gfortran.dg/goacc/loop-1.f95 (working copy) @@ -1,4 +1,5 @@ ! See also loop-1-2.f95. +! { dg-additional-options "-std=legacy" } module test implicit none @@ -32,14 +33,12 @@ subroutine test1 do 300 d = 1, 30, 6 i = d 300 a(i) = 1 - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 32 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 32 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 33 } !$acc loop do d = 1, 30, 5 i = d a(i) = 2 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 38 } ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 38 } !$acc loop do i = 1, 30 @@ -150,8 +149,7 @@ subroutine test1 do i = 1, 3 do r = 4, 6 end do - ! { dg-warning "Deleted feature: Loop variable at .1. must be integer" "" { target *-*-* } 151 } - ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 151 } + ! { dg-error "ACC LOOP iteration variable must be of type integer" "" { target *-*-* } 150 } end do ! Both seq and independent are not allowed Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (revision 260402) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.1.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (revision 260402) +++ gcc/testsuite/gfortran.dg/gomp/appendix-a/a.6.2.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-additional-options "-std=legacy" } SUBROUTINE WORK(I, J) INTEGER I,J Index: gcc/testsuite/gfortran.dg/gomp/do-1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/do-1.f90 (revision 260402) +++ gcc/testsuite/gfortran.dg/gomp/do-1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O -fopenmp -fdump-tree-omplower" } +! { dg-options "-O -fopenmp -fdump-tree-omplower -std=legacy" } subroutine foo (i, j, k, s, a) integer :: i, j, k, s, a(100), l Index: gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (revision 260402) +++ gcc/testsuite/gfortran.dg/gomp/omp_do1.f90 (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-fopenmp -std=gnu" } +! { dg-options "-fopenmp -std=legacy" } subroutine foo integer :: i, j integer, dimension (30) :: a @@ -24,11 +24,11 @@ subroutine foo i = i + 1 end do !$omp do - do 300 d = 1, 30, 6 ! { dg-warning "Deleted feature: Loop variable" } + do 300 d = 1, 30, 6 i = d 300 a(i) = 1 !$omp do - do d = 1, 30, 5 ! { dg-warning "Deleted feature: Loop variable" } + do d = 1, 30, 5 i = d a(i) = 2 end do Index: gcc/testsuite/gfortran.dg/pr37243.f =================================================================== --- gcc/testsuite/gfortran.dg/pr37243.f (revision 260402) +++ gcc/testsuite/gfortran.dg/pr37243.f (working copy) @@ -1,5 +1,6 @@ ! PR rtl-optimization/37243 ! { dg-do run } +! { dg-options "-std=legacy" } ! { dg-add-options ieee } ! Check if register allocator handles IR flattening correctly. SUBROUTINE SCHMD(V,M,N,LDV) @@ -13,10 +14,10 @@ DO 160 I = 1,M DUMI = ZERO DO 100 K = 1,N - 100 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 100 DUMI = DUMI+V(K,I)*V(K,I) DUMI = ONE/ SQRT(DUMI) DO 120 K = 1,N - 120 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 120 V(K,I) = V(K,I)*DUMI IF (I .EQ. M) GO TO 160 I1 = I+1 DO 140 J = I1,M @@ -34,15 +35,15 @@ 220 J = J+1 IF (J .GT. N) GO TO 320 DO 240 K = 1,N - 240 V(K,I) = ZERO ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 240 V(K,I) = ZERO CALL DAXPY(N,DUM,V(1,I),1,V(1,I),1) 260 CONTINUE DUMI = ZERO DO 280 K = 1,N - 280 DUMI = DUMI+V(K,I)*V(K,I) ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 280 DUMI = DUMI+V(K,I)*V(K,I) IF ( ABS(DUMI) .LT. TOL) GO TO 220 DO 300 K = 1,N - 300 V(K,I) = V(K,I)*DUMI ! { dg-warning "Obsolescent feature: DO termination statement which is not END DO or CONTINUE" } + 300 V(K,I) = V(K,I)*DUMI GO TO 200 320 END program main Index: gcc/testsuite/gfortran.dg/pr49721-1.f =================================================================== --- gcc/testsuite/gfortran.dg/pr49721-1.f (revision 260402) +++ gcc/testsuite/gfortran.dg/pr49721-1.f (working copy) @@ -1,6 +1,6 @@ ! PR middle-end/49721 ! { dg-do compile } -! { dg-options "-O3 -funroll-loops" } +! { dg-options "-O3 -funroll-loops -std=legacy" } subroutine midbloc6(c,a2,a2i,q) parameter (ndim2=6) Index: gcc/testsuite/gfortran.dg/pr58484.f =================================================================== --- gcc/testsuite/gfortran.dg/pr58484.f (revision 260402) +++ gcc/testsuite/gfortran.dg/pr58484.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O2" } +! { dg-options "-O2 -std=legacy" } SUBROUTINE UMPSE(AIBJ,NOC,NDIM,NOCA,NVIRA,NOCCA,E2) DIMENSION AIBJ(NOC,NDIM,*) DO 20 MA=1,NVIRA Index: gcc/testsuite/gfortran.dg/pr81175.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81175.f (revision 260402) +++ gcc/testsuite/gfortran.dg/pr81175.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-Ofast -fwrapv" } +! { dg-options "-Ofast -fwrapv -std=legacy" } ! { dg-additional-options "-march=broadwell" { target x86_64-*-* i?86-*-* } } SUBROUTINE ECPDRA(IC4C,FP,FQ,G) IMPLICIT DOUBLE PRECISION (A-H,O-Z) Index: gcc/testsuite/gfortran.dg/pr81723.f =================================================================== --- gcc/testsuite/gfortran.dg/pr81723.f (revision 260402) +++ gcc/testsuite/gfortran.dg/pr81723.f (working copy) @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-O3 -fno-automatic" } +! { dg-options "-O3 -fno-automatic -std=legacy" } FUNCTION WWERF(Z) Index: gcc/testsuite/gfortran.dg/predcom-2.f =================================================================== --- gcc/testsuite/gfortran.dg/predcom-2.f (revision 260402) +++ gcc/testsuite/gfortran.dg/predcom-2.f (working copy) @@ -1,7 +1,7 @@ ! PR 32220, ICE when the loop is not unrolled enough to eliminate all ! register copies ! { dg-do compile } -! { dg-options "-O3" } +! { dg-options "-O3 -std=legacy" } subroutine derv (b,cosxy,thick) c Index: gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 =================================================================== --- gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (revision 260402) +++ gcc/testsuite/gfortran.dg/vect/Ofast-pr50414.f90 (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } SUBROUTINE SUB (A,L,YMAX) DIMENSION A(L) Index: gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (revision 260402) +++ gcc/testsuite/gfortran.dg/vect/cost-model-pr34445a.f (working copy) @@ -1,4 +1,5 @@ c { dg-do compile } +c { dg-options "-std=legacy" } subroutine derv (xx,b,bv,det,r,s,t,ndopt,cosxy,thick,edis, 1 vni,vnt) implicit real*8 (a-h,o-z) Index: gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (revision 260402) +++ gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f (working copy) @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-require-effective-target vect_double } -! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details" } +! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details -std=legacy" } ! { dg-additional-options "-mprefer-avx128" { target { i?86-*-* x86_64-*-* } } } ! { dg-additional-options "-mzarch" { target { s390*-*-* } } } Index: gcc/testsuite/gfortran.dg/vect/pr52580.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/pr52580.f (revision 260402) +++ gcc/testsuite/gfortran.dg/vect/pr52580.f (working copy) @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=legacy" } ! { dg-require-effective-target vect_double } SUBROUTINE CALC2 IMPLICIT REAL*8 (A-H, O-Z)