From 3c0f026505aca54c200b36870256c886b05eb4ff Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Thu, 5 Sep 2019 20:13:00 +0000 Subject: [PATCH] re PR fortran/91496 (!GCC$ directives error if mistyped or unknown) 2019-09-05 Harald Anlauf PR fortran/91496 * parse.c (parse_executable): Improve error messages for improperly placed pragmas not preceeding a loop. PR fortran/91496 * gfortran.dg/directive_unroll_5.f90: Adjust error message. From-SVN: r275442 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/parse.c | 9 +++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/directive_unroll_5.f90 | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 129bfdd9ae7..9c787f73bfd 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-09-05 Harald Anlauf + + PR fortran/91496 + * parse.c (parse_executable): Improve error messages for + improperly placed pragmas not preceeding a loop. + 2019-09-05 Steven G. Kargl PR fortran/91660 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index caea16b9f5f..5bd04b839ce 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -5541,16 +5541,17 @@ parse_executable (gfc_statement st) } if (directive_unroll != -1) - gfc_error ("% directive does not commence a loop at %C"); + gfc_error ("% directive not at the start of a loop at %C"); if (directive_ivdep) - gfc_error ("% directive does not commence a loop at %C"); + gfc_error ("% directive not at the start of a loop at %C"); if (directive_vector) - gfc_error ("% directive does not commence a loop at %C"); + gfc_error ("% directive not at the start of a loop at %C"); if (directive_novector) - gfc_error ("% directive does not commence a loop at %C"); + gfc_error ("% " + "directive not at the start of a loop at %C"); st = next_statement (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a43cec3e282..faf5f15a60e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-09-05 Harald Anlauf + + PR fortran/91496 + * gfortran.dg/directive_unroll_5.f90: Adjust error message. + 2019-09-05 Steven G. Kargl PR fortran/91660 diff --git a/gcc/testsuite/gfortran.dg/directive_unroll_5.f90 b/gcc/testsuite/gfortran.dg/directive_unroll_5.f90 index b88b4b2c380..33f2fda537f 100644 --- a/gcc/testsuite/gfortran.dg/directive_unroll_5.f90 +++ b/gcc/testsuite/gfortran.dg/directive_unroll_5.f90 @@ -31,7 +31,7 @@ subroutine wrong3(a, b, n) integer :: a(n), b(n) integer (kind=4) :: i !GCC$ unroll 8 - write (*,*) "wrong"! { dg-error "directive does not commence a loop" } + write (*,*) "wrong"! { dg-error "directive not at the start of a loop" } DO i=n, 1, -1 call dummy2(a(i), b(i), i) ENDDO -- 2.30.2