re PR middle-end/33333 (ICE with #pragma omp parallel for in try/catch statement)

PR middle-end/33333
	* gimplify.c (gimplify_omp_for): Gimplify OMP_FOR_PRE_BODY.

	* g++.dg/gomp/pr33333.C: New test.

From-SVN: r131820
This commit is contained in:
Jakub Jelinek 2008-01-25 10:12:57 +01:00 committed by Jakub Jelinek
parent 765d600ac5
commit 80e67011e3
4 changed files with 31 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-01-25 Jakub Jelinek <jakub@redhat.com>
PR middle-end/33333
* gimplify.c (gimplify_omp_for): Gimplify OMP_FOR_PRE_BODY.
2008-01-25 Golovanevsky Olga <olga@il.ibm.com>
* ipa-struct-reorg.c (remove_str_allocs_in_func, remove_str_allocs):

View File

@ -5330,6 +5330,10 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
else
var = decl;
/* If OMP_FOR is re-gimplified, ensure all variables in pre-body
are noticed. */
gimplify_stmt (&OMP_FOR_PRE_BODY (for_stmt));
ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
&OMP_FOR_PRE_BODY (for_stmt),
NULL, is_gimple_val, fb_rvalue);

View File

@ -1,5 +1,8 @@
2008-01-25 Jakub Jelinek <jakub@redhat.com>
PR middle-end/33333
* g++.dg/gomp/pr33333.C: New test.
PR preprocessor/34692
* gcc.dg/cpp/pr34692.c: New test.
* gcc.dg/gomp/pr34692.c: New test.

View File

@ -0,0 +1,19 @@
// PR middle-end/33333
// { dg-do compile }
struct A
{
int n;
void foo ();
};
void
A::foo ()
{
try
{
#pragma omp parallel for
for (int i = 0; i < n; ++i)
;
} catch (...) {}
}