aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2015-10-27 17:54:52 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2015-10-27 17:54:52 +0100
commit33497fd242760dcd0db7f69596a0aec21c735b35 (patch)
tree42870bcd2643f2dd30e91b84a0dbf6619385a2c5 /gcc/fortran/openmp.c
parentd34b48146ac2f07e78825c3e99da2e2e588f3c3d (diff)
downloadgcc-33497fd242760dcd0db7f69596a0aec21c735b35.zip
gcc-33497fd242760dcd0db7f69596a0aec21c735b35.tar.gz
gcc-33497fd242760dcd0db7f69596a0aec21c735b35.tar.bz2
[PR fortran/63865] OpenACC cache directive: match Fortran support with C/C++
gcc/fortran/ PR fortran/63865 * openmp.c (resolve_oacc_cache): Remove function. (gfc_match_oacc_cache): Enable array sections. (resolve_omp_clauses, gfc_resolve_oacc_directive): Change accordingly. * trans-openmp.c (gfc_trans_omp_clauses): Likewise. gcc/testsuite/ PR fortran/63865 * gfortran.dg/goacc/coarray.f95: Expect the OpenACC cache directive to work. * gfortran.dg/goacc/loop-1.f95: Likewise. * gfortran.dg/goacc/cache-1.f95: Likewise, and extend testing. * gfortran.dg/goacc/cray.f95: Likewise. * gfortran.dg/goacc/parameter.f95: Likewise. Co-Authored-By: James Norris <jnorris@codesourcery.com> From-SVN: r229448
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 3c12d8e..6c78c97 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -1387,7 +1387,8 @@ gfc_match_oacc_cache (void)
{
gfc_omp_clauses *c = gfc_get_omp_clauses ();
match m = gfc_match_omp_variable_list (" (",
- &c->lists[OMP_LIST_CACHE], true);
+ &c->lists[OMP_LIST_CACHE], true,
+ NULL, NULL, true);
if (m != MATCH_YES)
{
gfc_free_omp_clauses(c);
@@ -3107,6 +3108,7 @@ resolve_omp_clauses (gfc_code *code, locus *where,
case OMP_LIST_MAP:
case OMP_LIST_TO:
case OMP_LIST_FROM:
+ case OMP_LIST_CACHE:
for (; n != NULL; n = n->next)
{
if (n->expr)
@@ -3380,7 +3382,6 @@ resolve_omp_clauses (gfc_code *code, locus *where,
n->sym->name, name, where);
/* FALLTHRU */
case OMP_LIST_DEVICE_RESIDENT:
- case OMP_LIST_CACHE:
check_symbol_not_pointer (n->sym, *where, name);
check_array_not_assumed (n->sym, *where, name);
break;
@@ -4597,13 +4598,6 @@ resolve_oacc_loop (gfc_code *code)
}
-static void
-resolve_oacc_cache (gfc_code *code ATTRIBUTE_UNUSED)
-{
- sorry ("Sorry, !$ACC cache unimplemented yet");
-}
-
-
void
gfc_resolve_oacc_declare (gfc_namespace *ns)
{
@@ -4657,6 +4651,7 @@ gfc_resolve_oacc_directive (gfc_code *code, gfc_namespace *ns ATTRIBUTE_UNUSED)
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
case EXEC_OACC_WAIT:
+ case EXEC_OACC_CACHE:
resolve_omp_clauses (code, &code->loc, code->ext.omp_clauses, NULL,
true);
break;
@@ -4665,9 +4660,6 @@ gfc_resolve_oacc_directive (gfc_code *code, gfc_namespace *ns ATTRIBUTE_UNUSED)
case EXEC_OACC_LOOP:
resolve_oacc_loop (code);
break;
- case EXEC_OACC_CACHE:
- resolve_oacc_cache (code);
- break;
default:
break;
}