diff options
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 506ad18..2312bc3 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1008,7 +1008,18 @@ gimplify_bind_expr (tree *expr_p, tree temp, tree *pre_p) for (t = BIND_EXPR_VARS (bind_expr); t ; t = TREE_CHAIN (t)) { if (TREE_CODE (t) == VAR_DECL) - DECL_SEEN_IN_BIND_EXPR_P (t) = 1; + { + struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp; + + /* Mark variable as local. */ + if (ctx && !is_global_var (t) + && (! DECL_SEEN_IN_BIND_EXPR_P (t) + || splay_tree_lookup (ctx->variables, + (splay_tree_key) t) == NULL)) + omp_add_variable (gimplify_omp_ctxp, t, GOVD_LOCAL | GOVD_SEEN); + + DECL_SEEN_IN_BIND_EXPR_P (t) = 1; + } /* Preliminarily mark non-addressed complex variables as eligible for promotion to gimple registers. We'll transform their uses @@ -1020,16 +1031,6 @@ gimplify_bind_expr (tree *expr_p, tree temp, tree *pre_p) DECL_COMPLEX_GIMPLE_REG_P (t) = 1; } - /* Mark variables seen in this bind expr as locals. */ - if (gimplify_omp_ctxp) - { - struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp; - - for (t = BIND_EXPR_VARS (bind_expr); t ; t = TREE_CHAIN (t)) - if (TREE_CODE (t) == VAR_DECL && !is_global_var (t)) - omp_add_variable (ctx, t, GOVD_LOCAL | GOVD_SEEN); - } - gimple_push_bind_expr (bind_expr); gimplify_ctxp->save_stack = false; |