aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2019-12-20 11:22:52 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2019-12-20 12:22:52 +0100
commite565e49fb22cb466dc8af0dc09a061b30806cc04 (patch)
tree8777317532d57be3672b1f1824d9f20928205f39 /gcc/fortran/openmp.c
parent74a7b87a008bfaca392980dfedb30730a8f256e4 (diff)
downloadgcc-e565e49fb22cb466dc8af0dc09a061b30806cc04.zip
gcc-e565e49fb22cb466dc8af0dc09a061b30806cc04.tar.gz
gcc-e565e49fb22cb466dc8af0dc09a061b30806cc04.tar.bz2
Improve is-coindexed check for OpenACC/OpenMP
gcc/fortran/ * openmp.c (resolve_omp_clauses): Move is-coindexed check from here ... (gfc_match_omp_variable_list): ... to here. gcc/testsuite/ * gfortran.dg/goacc/coindexed-1.f90: New. From-SVN: r279637
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 051b4bd..01964f9 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -274,6 +274,11 @@ gfc_match_omp_variable_list (const char *str, gfc_omp_namelist **list,
default:
break;
}
+ if (gfc_is_coindexed (expr))
+ {
+ gfc_error ("List item shall not be coindexed at %C");
+ goto cleanup;
+ }
}
gfc_set_sym_referenced (sym);
p = gfc_get_omp_namelist ();
@@ -4544,9 +4549,6 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
gfc_error ("%qs in %s clause at %L is not a proper "
"array section", n->sym->name, name,
&n->where);
- else if (gfc_is_coindexed (n->expr))
- gfc_error ("Entry shall not be coindexed in %s "
- "clause at %L", name, &n->where);
else
{
int i;