summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-27 07:52:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-27 07:52:28 +0000
commit93768ef7854f04b9b09aa88b926967a55e37ad5f (patch)
treed17be163d5873dd2df5a75cc7d91cd0976c4bd21 /gcc/fortran/trans-openmp.c
parentec6e628c37002d48759c793870b41f4c411aa82d (diff)
PR fortran/77666
* trans-openmp.c (gfc_omp_private_outer_ref): Return true even for references to allocatable arrays. * gfortran.dg/gomp/pr77666.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index e4a2975719e6..b8b8576f366e 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -207,6 +207,9 @@ gfc_omp_private_outer_ref (tree decl)
{
tree type = TREE_TYPE (decl);
+ if (gfc_omp_privatize_by_reference (decl))
+ type = TREE_TYPE (type);
+
if (GFC_DESCRIPTOR_TYPE_P (type)
&& GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
return true;
@@ -214,9 +217,6 @@ gfc_omp_private_outer_ref (tree decl)
if (GFC_DECL_GET_SCALAR_ALLOCATABLE (decl))
return true;
- if (gfc_omp_privatize_by_reference (decl))
- type = TREE_TYPE (type);
-
if (gfc_has_alloc_comps (type, decl))
return true;