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
This commit is contained in:
Jakub Jelinek 2006-03-24 17:14:40 +01:00 committed by Jakub Jelinek
parent 84c9cb12e6
commit 8cb86b657c
5 changed files with 55 additions and 11 deletions

View file

@ -1,3 +1,10 @@
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

View file

@ -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;

View file

@ -1,3 +1,9 @@
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.

View file

@ -0,0 +1,15 @@
// PR middle-end/26611
// { dg-do compile }
void
foo ()
{
#pragma omp parallel
try
{
int q = 1;
}
catch (...)
{
}
}

View file

@ -0,0 +1,15 @@
// PR middle-end/26611
// { dg-do compile }
void
foo ()
{
#pragma omp parallel
try
{
}
catch (...)
{
int q = 1;
}
}