summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-30 17:39:52 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-30 17:39:52 +0000
commit720a0bce9fa0bda69f32c4acfef4433a670b1d44 (patch)
tree3a088fb6ebdb57541d5260fd4ddb760455645693 /gcc/fortran/trans-openmp.c
parent17c32c4aaee6a6e98fad4c8340023217c0ed1054 (diff)
PR fortran/71705
* trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on decls in to/from clauses. * gfortran.dg/gomp/pr71705.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237887 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r--gcc/fortran/trans-openmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index ab07fe45be9e..b005d392f477 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -2182,6 +2182,8 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
tree decl = gfc_get_symbol_decl (n->sym);
if (gfc_omp_privatize_by_reference (decl))
decl = build_fold_indirect_ref (decl);
+ else if (DECL_P (decl))
+ TREE_ADDRESSABLE (decl) = 1;
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
{
tree type = TREE_TYPE (decl);