diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-04-26 09:29:46 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-04-26 09:29:46 +0200 |
commit | e0eb05eaa18608b8aacd94d1c74ceac2ea581191 (patch) | |
tree | 8e713314d70a2457d3d1988305713743db656680 /gcc | |
parent | 29173496a0453f740b280bcc1f1ddbebc2726ced (diff) | |
download | gcc-e0eb05eaa18608b8aacd94d1c74ceac2ea581191.zip gcc-e0eb05eaa18608b8aacd94d1c74ceac2ea581191.tar.gz gcc-e0eb05eaa18608b8aacd94d1c74ceac2ea581191.tar.bz2 |
re PR tree-optimization/30558 (ICE with OpenMP and exceptions)
PR tree-optimization/30558
* tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW
clear this_state.prev_try.
* g++.dg/gomp/pr30558.C: New test.
From-SVN: r124177
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/pr30558.C | 41 | ||||
-rw-r--r-- | gcc/tree-eh.c | 4 |
4 files changed, 56 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad1928a..b99d527 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-04-26 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/30558 + * tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW + clear this_state.prev_try. + 2007-04-26 Richard Sandiford <richard@codesourcery.com> Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 04a98ad..d75284c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-04-26 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/30558 + * g++.dg/gomp/pr30558.C: New test. + 2007-04-24 Mark Mitchell <mark@codesourcery.com> PR c++/31338 diff --git a/gcc/testsuite/g++.dg/gomp/pr30558.C b/gcc/testsuite/g++.dg/gomp/pr30558.C new file mode 100644 index 0000000..e492922 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr30558.C @@ -0,0 +1,41 @@ +// PR tree-optimization/30558 +// { dg-do compile } +// { dg-options "-fopenmp" } + +template <typename T> struct F +{ + ~F (); + F (T); + const T &operator[] (unsigned i) const; +}; + +template <typename T> F<T> foo (const F<T> &x) +{ + return F<T> (x[1]); +} + +struct G +{ + G () { bar (2); } + F<int> &operator () (F<int> x); + void bar (int); +}; + +int +main () +{ + try + { + G g; +#pragma omp parallel for + for (int i = 0; i < 10; ++i) + { + F<int> j (i); + F<int> f = g (j); + F<int> h = foo (f); + } + } + catch (int &e) + { + } +} diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index edd17cb..37fce85 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1497,6 +1497,10 @@ lower_eh_filter (struct leh_state *state, tree *tp) EH_FILTER_TYPES (inner)); this_state = *state; this_state.cur_region = this_region; + /* For must not throw regions any cleanup regions inside it + can't reach outer catch regions. */ + if (EH_FILTER_MUST_NOT_THROW (inner)) + this_state.prev_try = NULL; lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0)); |