aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-06-18 15:27:30 +0200
committerTobias Burnus <tobias@codesourcery.com>2020-06-18 15:27:30 +0200
commitac70b20b1007da0d3d02a9cec3c0715145c4b593 (patch)
treed4ec5d6ca6ca715e1d05773262ef0a84573b366f /gcc/fortran/openmp.c
parenteccc3d432669ba272229d49f015cb986df21eb0a (diff)
downloadgcc-ac70b20b1007da0d3d02a9cec3c0715145c4b593.zip
gcc-ac70b20b1007da0d3d02a9cec3c0715145c4b593.tar.gz
gcc-ac70b20b1007da0d3d02a9cec3c0715145c4b593.tar.bz2
OpenMP/Fortran: Reject allocatable components in map clause
gcc/fortran/ChangeLog: * openmp.c (resolve_omp_clauses): Reject vars with allocatable components in OpenMP map clauses. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/map-alloc-comp-1.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 94522d1..e681903 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -4636,6 +4636,13 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&& n->sym->as->type == AS_ASSUMED_SIZE)
gfc_error ("Assumed size array %qs in %s clause at %L",
n->sym->name, name, &n->where);
+ if (!openacc
+ && list == OMP_LIST_MAP
+ && n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->attr.alloc_comp)
+ gfc_error ("List item %qs with allocatable components is not "
+ "permitted in map clause at %L", n->sym->name,
+ &n->where);
if (list == OMP_LIST_MAP && !openacc)
switch (code->op)
{