aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/trans-openmp.cc')
-rw-r--r--gcc/fortran/trans-openmp.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index d1c05d0..03d9432 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -2790,9 +2790,6 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
case OMP_LIST_USE:
clause_code = OMP_CLAUSE_USE;
goto add_clause;
- case OMP_LIST_DESTROY:
- clause_code = OMP_CLAUSE_DESTROY;
- goto add_clause;
case OMP_LIST_INTEROP:
clause_code = OMP_CLAUSE_INTEROP;
goto add_clause;
@@ -2803,6 +2800,22 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
declare_simd);
break;
+ case OMP_LIST_DESTROY:
+ for (; n != NULL; n = n->next)
+ if (n->sym->attr.referenced)
+ {
+ tree t = gfc_trans_omp_variable (n->sym, declare_simd);
+ if (t != error_mark_node)
+ {
+ tree node
+ = build_omp_clause (input_location, OMP_CLAUSE_DESTROY);
+ OMP_CLAUSE_DECL (node) = t;
+ TREE_ADDRESSABLE (OMP_CLAUSE_DECL (node)) = 1;
+ omp_clauses = gfc_trans_add_clause (node, omp_clauses);
+ }
+ }
+ break;
+
case OMP_LIST_INIT:
{
tree pref_type = NULL_TREE;
@@ -2816,6 +2829,7 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
tree node = build_omp_clause (input_location,
OMP_CLAUSE_INIT);
OMP_CLAUSE_DECL (node) = t;
+ TREE_ADDRESSABLE (OMP_CLAUSE_DECL (node)) = 1;
if (n->u.init.target)
OMP_CLAUSE_INIT_TARGET (node) = 1;
if (n->u.init.targetsync)
@@ -8966,8 +8980,8 @@ gfc_trans_omp_declare_variant (gfc_namespace *ns, gfc_namespace *parent_ns)
tree pref = NULL_TREE;
if (n->u.init.len)
{
- tree pref = build_string (n->u.init.len,
- n->u2.init_interop);
+ pref = build_string (n->u.init.len,
+ n->u2.init_interop);
TREE_TYPE (pref) = build_array_type_nelts (
unsigned_char_type_node,
n->u.init.len);