aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-02-04 12:32:59 +0100
committerTobias Burnus <tobias@codesourcery.com>2021-02-04 12:32:59 +0100
commitf0e618faeb619ec02dabbef203a5575fca44a7f7 (patch)
tree60a765f2ae1c6de5b437e72f948a1a8582af9403 /gcc/fortran/openmp.c
parent5eb792e7a12ad214e5295e3f664637078936213f (diff)
downloadgcc-f0e618faeb619ec02dabbef203a5575fca44a7f7.zip
gcc-f0e618faeb619ec02dabbef203a5575fca44a7f7.tar.gz
gcc-f0e618faeb619ec02dabbef203a5575fca44a7f7.tar.bz2
Fortran: OpenMP/OpenACC diagnose substring rejections better
gcc/fortran/ChangeLog: * openmp.c (resolve_omp_clauses): Explicitly diagnose substrings as not permitted. gcc/testsuite/ChangeLog: * gfortran.dg/goacc/substring.f90: New test. * gfortran.dg/gomp/substring.f90: New test.
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 9a3a8f6..aab17f0 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -5212,7 +5212,13 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
|| (n->expr
&& (!resolved || n->expr->expr_type != EXPR_VARIABLE)))
{
- if (!resolved
+ if (array_ref
+ && (array_ref->type == REF_SUBSTRING
+ || (array_ref->next
+ && array_ref->next->type == REF_SUBSTRING)))
+ gfc_error ("Unexpected substring reference in %s clause "
+ "at %L", name, &n->where);
+ else if (!resolved
|| n->expr->expr_type != EXPR_VARIABLE
|| array_ref->next
|| array_ref->type != REF_ARRAY)