aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-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/trans-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/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index def8afb..3be9f51 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1778,9 +1778,6 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
case OMP_LIST_DEVICE_RESIDENT:
clause_code = OMP_CLAUSE_DEVICE_RESIDENT;
goto add_clause;
- case OMP_LIST_CACHE:
- clause_code = OMP_CLAUSE__CACHE_;
- goto add_clause;
add_clause:
omp_clauses
@@ -2159,14 +2156,27 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
break;
case OMP_LIST_TO:
case OMP_LIST_FROM:
+ case OMP_LIST_CACHE:
for (; n != NULL; n = n->next)
{
if (!n->sym->attr.referenced)
continue;
- tree node = build_omp_clause (input_location,
- list == OMP_LIST_TO
- ? OMP_CLAUSE_TO : OMP_CLAUSE_FROM);
+ switch (list)
+ {
+ case OMP_LIST_TO:
+ clause_code = OMP_CLAUSE_TO;
+ break;
+ case OMP_LIST_FROM:
+ clause_code = OMP_CLAUSE_FROM;
+ break;
+ case OMP_LIST_CACHE:
+ clause_code = OMP_CLAUSE__CACHE_;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ tree node = build_omp_clause (input_location, clause_code);
if (n->expr == NULL || n->expr->ref->u.ar.type == AR_FULL)
{
tree decl = gfc_get_symbol_decl (n->sym);