aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorCesar Philippidis <cesar@codesourcery.com>2015-12-02 11:59:27 -0800
committerCesar Philippidis <cesar@gcc.gnu.org>2015-12-02 11:59:27 -0800
commit2f9bcf538c95f97e7920dc6c91085c4180678d63 (patch)
tree36c3f7c349c45914575bc3fab67cd3e384765a5b /gcc/fortran/openmp.c
parente7fc41a776a1e85fd052fc84184618768274a1af (diff)
downloadgcc-2f9bcf538c95f97e7920dc6c91085c4180678d63.zip
gcc-2f9bcf538c95f97e7920dc6c91085c4180678d63.tar.gz
gcc-2f9bcf538c95f97e7920dc6c91085c4180678d63.tar.bz2
re PR fortran/63861 (OpenACC coarray ICE (also with OpenMP?))
gcc/fortran/ PR fortran/63861 * openmp.c (gfc_match_omp_clauses): Allow subarrays for acc reductions. (resolve_omp_clauses): Error on any acc reductions on arrays. gcc/testsuite/ * gfortran.dg/goacc/array-reduction.f90: New test. * gfortran.dg/goacc/assumed.f95: Update expected diagnostics. * gfortran.dg/goacc/coarray.f95: Likewise. * gfortran.dg/goacc/coarray_2.f90: Likewise. * gfortran.dg/goacc/reduction-2.f95: Likewise. * gfortran.dg/goacc/reduction.f95: Likewise. From-SVN: r231204
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 6182464..276f2f1 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -978,7 +978,8 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask,
if (gfc_match_omp_variable_list (" :",
&c->lists[OMP_LIST_REDUCTION],
- false, NULL, &head) == MATCH_YES)
+ false, NULL, &head, openacc)
+ == MATCH_YES)
{
gfc_omp_namelist *n;
if (rop == OMP_REDUCTION_NONE)
@@ -3313,6 +3314,11 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
n->sym->name, &n->where);
else
n->sym->mark = 1;
+
+ /* OpenACC does not support reductions on arrays. */
+ if (n->sym->as)
+ gfc_error ("Array %qs is not permitted in reduction at %L",
+ n->sym->name, &n->where);
}
}