+2006-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/26611
+ * gimplify.c (gimplify_bind_expr): Only call omp_add_variable on
+ non-global variables that don't have DECL_SEEN_IN_BIND_EXPR_P bit
+ set yet or weren't marked as local yet.
+
2006-03-24 Bernd Schmidt <bernd.schmidt@analog.com>
* regrename.c (scan_rtx_address): Initialize a variable to shut up
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
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;
+2006-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/26611
+ * g++.dg/gomp/pr26611-1.C: New test.
+ * g++.dg/gomp/pr26611-2.C: New test.
+
2006-03-24 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/pr26833.c: New test.