This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp] Handle RESX_EXPR in find_outermost_region_in_block (PR middle-end/26913)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Apr 2006 09:49:09 -0400
- Subject: [gomp] Handle RESX_EXPR in find_outermost_region_in_block (PR middle-end/26913)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
RESX_EXPRs aren't stored in eh->throw_stmt_table hash table, but
their first argument is the EH region number that is being left.
So, lookup_stmt_eh_region_fn was always returning -1 for them and
thus the referenced EH region could not be duplicated over, yet
move_block_to_fn would adjust RESX_EXPR's operand to a region that
wasn't duplicated.
Ok for trunk?
2006-04-18 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26913
* tree-cfg.c (find_outermost_region_in_block): Handle RESX_EXPR.
* g++.dg/gomp/pr26913.C: New test.
--- gcc/tree-cfg.c.jj 2006-04-15 08:53:08.000000000 +0200
+++ gcc/tree-cfg.c 2006-04-18 15:33:42.000000000 +0200
@@ -4744,7 +4744,10 @@ find_outermost_region_in_block (struct f
tree stmt = bsi_stmt (si);
int stmt_region;
- stmt_region = lookup_stmt_eh_region_fn (src_cfun, stmt);
+ if (TREE_CODE (stmt) == RESX_EXPR)
+ stmt_region = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+ else
+ stmt_region = lookup_stmt_eh_region_fn (src_cfun, stmt);
if (stmt_region > 0)
{
if (region < 0)
--- gcc/testsuite/g++.dg/gomp/pr26913.C.jj 2006-04-18 15:35:58.000000000 +0200
+++ gcc/testsuite/g++.dg/gomp/pr26913.C 2006-04-18 15:36:38.000000000 +0200
@@ -0,0 +1,19 @@
+// PR middle-end/26913
+
+struct A
+{
+ ~A () throw ();
+};
+
+void foo (A);
+
+A bar () throw ();
+
+void baz ()
+{
+#pragma omp parallel
+ {
+ A a;
+ foo (bar ());
+ }
+}
Jakub