summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-12 12:16:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-12 12:16:54 +0000
commit7ba2cc333dd01467a2a66705460d9cce9740d813 (patch)
tree393a1c7458b43284abbfb7883e8b69cce2548c5f /gcc/fortran/trans-openmp.c
parent1d4336dfdab0ff4b0da9f789543cf06f688535d3 (diff)
PR fortran/32550
* trans.h (GFC_POINTER_TYPE_P): Define. * trans-types.c (gfc_sym_type): Set it for types on attr->sym.pointer. * trans-openmp.c (gfc_omp_privatize_by_reference): Return false if GFC_POINTER_TYPE_P is set on the type. * testsuite/libgomp.fortran/pr32550.f90: New test. * testsuite/libgomp.fortran/crayptr2.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126583 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 7c381db4f6e5..b0683308f755 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -50,9 +50,12 @@ gfc_omp_privatize_by_reference (tree decl)
if (TREE_CODE (type) == POINTER_TYPE)
{
- /* POINTER/ALLOCATABLE have aggregate types, all user variables
- that have POINTER_TYPE type are supposed to be privatized
- by reference. */
+ /* Array POINTER/ALLOCATABLE have aggregate types, all user variables
+ that have POINTER_TYPE type and don't have GFC_POINTER_TYPE_P
+ set are supposed to be privatized by reference. */
+ if (GFC_POINTER_TYPE_P (type))
+ return false;
+
if (!DECL_ARTIFICIAL (decl))
return true;