Martin Jambor <jamborm at gcc dot> changed:

           What    |Removed                     |Added
                 CC|                            |jakub at gcc dot

--- Comment #4 from Martin Jambor <jamborm at gcc dot> ---
The variable is introduced to the clause in the omp_finish_clause
lang_hook.  The following patch (untested) fixes it for me.  Jakub, is
it even remotely close to a proper fix?

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c8de1e6..98c63d1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -7733,6 +7733,10 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void
   struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp;
   gimplify_omp_ctxp = ctx->outer_context;
   lang_hooks.decls.omp_finish_clause (clause, pre_p);
+  if (code == OMP_CLAUSE_MAP
+      && gimplify_omp_ctxp
+      && DECL_P (OMP_CLAUSE_SIZE (clause)))
+    omp_notice_variable (gimplify_omp_ctxp, OMP_CLAUSE_SIZE (clause), true);
   gimplify_omp_ctxp = ctx;
   return 0;

Reply via email to