summaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorcltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-14 18:19:10 +0000
committercltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-14 18:19:10 +0000
commit9b90f118bf18e1b07fcb196a007dbcd701bbdad6 (patch)
tree670bf5a89694b2fc6c21a4f52a1aae8f2634f51a /gcc/fortran/openmp.c
parentc431e7bee52eb61f09453a7f1a0f4b42e58fdd29 (diff)
downloadgcc-9b90f118bf18e1b07fcb196a007dbcd701bbdad6.tar.gz
2016-08-14 Chung-Lin Tang <cltang@codesourcery.com>
PR fortran/70598 gcc/fortran/ * openmp.c (resolve_omp_clauses): Adjust use_device clause handling to only allow pointers and arrays. gcc/testsuite/ * gfortran.dg/goacc/host_data-tree.f95: Adjust to use pointers in use_device clause. * gfortran.dg/goacc/uninit-use-device-clause.f95: Likewise. * gfortran.dg/goacc/list.f95: Adjust to catch "neither a POINTER nor an array" error messages. libgomp/ * testsuite/libgomp.oacc-fortran/host_data-1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239457 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 2fed4918907..f50e6e83d91 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -3758,17 +3758,24 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&& CLASS_DATA (n->sym)->attr.allocatable))
gfc_error ("ALLOCATABLE object %qs in %s clause at %L",
n->sym->name, name, &n->where);
- if (n->sym->attr.pointer
- || (n->sym->ts.type == BT_CLASS && CLASS_DATA (n->sym)
- && CLASS_DATA (n->sym)->attr.class_pointer))
- gfc_error ("POINTER object %qs in %s clause at %L",
- n->sym->name, name, &n->where);
+ if (n->sym->ts.type == BT_CLASS
+ && CLASS_DATA (n->sym)
+ && CLASS_DATA (n->sym)->attr.class_pointer)
+ gfc_error ("POINTER object %qs of polymorphic type in "
+ "%s clause at %L", n->sym->name, name,
+ &n->where);
if (n->sym->attr.cray_pointer)
gfc_error ("Cray pointer object %qs in %s clause at %L",
n->sym->name, name, &n->where);
- if (n->sym->attr.cray_pointee)
+ else if (n->sym->attr.cray_pointee)
gfc_error ("Cray pointee object %qs in %s clause at %L",
n->sym->name, name, &n->where);
+ else if (n->sym->attr.flavor == FL_VARIABLE
+ && !n->sym->as
+ && !n->sym->attr.pointer)
+ gfc_error ("%s clause variable %qs at %L is neither "
+ "a POINTER nor an array", name,
+ n->sym->name, &n->where);
/* FALLTHRU */
case OMP_LIST_DEVICE_RESIDENT:
check_symbol_not_pointer (n->sym, n->where, name);