From e711928b48b62d04a44c098322441fe80ea88839 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 16 Mar 2017 17:50:27 +0100 Subject: [PATCH] re PR fortran/80010 (diagnostics: typo $!) PR fortran/80010 * parse.c (gfc_ascii_statement): Use !$ACC for ST_OACC_ATOMIC and ST_OACC_END_ATOMIC, instead of !ACC. * trans-decl.c (finish_oacc_declare): Use !$ACC instead of $!ACC. * openmp.c (gfc_match_oacc_declare, gfc_match_oacc_wait, gfc_resolve_oacc_declare): Likewise. * gfortran.dg/goacc/asyncwait-3.f95: Adjust expected diagnostic. From-SVN: r246204 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/openmp.c | 10 +++++----- gcc/fortran/parse.c | 4 ++-- gcc/fortran/trans-decl.c | 2 +- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gfortran.dg/goacc/asyncwait-3.f95 | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b617d45ca86..ffad6187e5e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2017-03-16 Jakub Jelinek + PR fortran/80010 + * parse.c (gfc_ascii_statement): Use !$ACC for ST_OACC_ATOMIC + and ST_OACC_END_ATOMIC, instead of !ACC. + * trans-decl.c (finish_oacc_declare): Use !$ACC instead of $!ACC. + * openmp.c (gfc_match_oacc_declare, gfc_match_oacc_wait, + gfc_resolve_oacc_declare): Likewise. + PR fortran/79886 * error.c (gfc_format_decoder): Rename plus argument to set_locus, remove ATTRIBUTE_UNUSED from all arguments, call default_tree_printer diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 753dc5ada59..46f8952a179 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2059,7 +2059,7 @@ gfc_match_oacc_declare (void) if (n->u.map_op != OMP_MAP_FORCE_ALLOC && n->u.map_op != OMP_MAP_FORCE_TO) { - gfc_error ("Invalid clause in module with $!ACC DECLARE at %L", + gfc_error ("Invalid clause in module with !$ACC DECLARE at %L", &where); return MATCH_ERROR; } @@ -2069,7 +2069,7 @@ gfc_match_oacc_declare (void) if (s->attr.use_assoc) { - gfc_error ("Variable is USE-associated with $!ACC DECLARE at %L", + gfc_error ("Variable is USE-associated with !$ACC DECLARE at %L", &where); return MATCH_ERROR; } @@ -2077,7 +2077,7 @@ gfc_match_oacc_declare (void) if ((s->attr.dimension || s->attr.codimension) && s->attr.dummy && s->as->type != AS_EXPLICIT) { - gfc_error ("Assumed-size dummy array with $!ACC DECLARE at %L", + gfc_error ("Assumed-size dummy array with !$ACC DECLARE at %L", &where); return MATCH_ERROR; } @@ -2172,7 +2172,7 @@ gfc_match_oacc_wait (void) { if (el->expr == NULL) { - gfc_error ("Invalid argument to $!ACC WAIT at %L", + gfc_error ("Invalid argument to !$ACC WAIT at %L", &wait_list->expr->where); return MATCH_ERROR; } @@ -5985,7 +5985,7 @@ gfc_resolve_oacc_declare (gfc_namespace *ns) if (n->expr && n->expr->ref->type == REF_ARRAY) { gfc_error ("Array sections: %qs not allowed in" - " $!ACC DECLARE at %L", n->sym->name, &oc->loc); + " !$ACC DECLARE at %L", n->sym->name, &oc->loc); continue; } } diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 28fa218b2fc..305a036a71e 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -2128,10 +2128,10 @@ gfc_ascii_statement (gfc_statement st) p = "!$ACC ROUTINE"; break; case ST_OACC_ATOMIC: - p = "!ACC ATOMIC"; + p = "!$ACC ATOMIC"; break; case ST_OACC_END_ATOMIC: - p = "!ACC END ATOMIC"; + p = "!$ACC END ATOMIC"; break; case ST_OMP_ATOMIC: p = "!$OMP ATOMIC"; diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 449ca9a84da..efff9a15ac3 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -6133,7 +6133,7 @@ finish_oacc_declare (gfc_namespace *ns, gfc_symbol *sym, bool block) continue; if (block) - gfc_error ("Sorry, $!ACC DECLARE at %L is not allowed " + gfc_error ("Sorry, !$ACC DECLARE at %L is not allowed " "in BLOCK construct", &oc->loc); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2fbdeb581ad..d32307fc4a5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-03-16 Jakub Jelinek + PR fortran/80010 + * gfortran.dg/goacc/asyncwait-3.f95: Adjust expected diagnostic. + PR fortran/79886 * gfortran.dg/pr79886.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/goacc/asyncwait-3.f95 b/gcc/testsuite/gfortran.dg/goacc/asyncwait-3.f95 index ed72a9ba28a..5c55c36e0ac 100644 --- a/gcc/testsuite/gfortran.dg/goacc/asyncwait-3.f95 +++ b/gcc/testsuite/gfortran.dg/goacc/asyncwait-3.f95 @@ -23,7 +23,7 @@ program asyncwait !$acc wait (1 ! { dg-error "Syntax error in OpenACC expression list at" } - !$acc wait (1, *) ! { dg-error "Invalid argument to \\\$\\\!ACC WAIT" } + !$acc wait (1, *) ! { dg-error "Invalid argument to \\\!\\\$ACC WAIT" } !$acc wait (1, a) ! { dg-error "WAIT clause at \\\(1\\\) requires a scalar INTEGER expression" } -- 2.30.2