aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-03-24 17:14:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2006-03-24 17:14:40 +0100
commit8cb86b657cad001ff77e8dc5d74b3bb5f9f9a7f1 (patch)
tree1708209878e668ef1acab5b79c98eb65413a0f13 /gcc/gimplify.c
parent84c9cb12e6b48fbc65260b979a4e0631f1e9e853 (diff)
downloadgcc-8cb86b657cad001ff77e8dc5d74b3bb5f9f9a7f1.zip
gcc-8cb86b657cad001ff77e8dc5d74b3bb5f9f9a7f1.tar.gz
gcc-8cb86b657cad001ff77e8dc5d74b3bb5f9f9a7f1.tar.bz2
re PR middle-end/26611 (openmp gomp ICE at gimplify.c:4257)
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. * g++.dg/gomp/pr26611-1.C: New test. * g++.dg/gomp/pr26611-2.C: New test. From-SVN: r112351
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c23
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;