This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 4351, sjlj exception handling, HP-UX
- From: Richard Henderson <rth at redhat dot com>
- To: Craig Rodrigues <rodrigc at mediaone dot net>, jessica at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org, law at redhat dot com, mark at codesourcery dot com
- Date: Tue, 11 Dec 2001 15:09:03 -0800
- Subject: Re: PR 4351, sjlj exception handling, HP-UX
- References: <20011206144637.A23934@mediaone.net>
On Thu, Dec 06, 2001 at 02:46:37PM -0500, Craig Rodrigues wrote:
> Jessica Han <jessica@cup.hp.com>:
> PortableServer::POA::AdapterAlreadyExists::_raise() {throw *this;}" has
> only one exception handling region, and it is marked as
> "ERT_MUST_NOT_THROW". It doesn't have any directly reachable region ...
If there were no directly reachable regions, then we shouldn't have
gotten this far. In particular, sjlj_find_directly_reachable_regions
should have returned false.
The problem exposed by this test case is that ERT_MUST_NOT_THROW
(in this case) is completely handled by the runtime library, and
does not generate a handler in the function.
This appears to fix the problem. Would you verify that this works
for you on the PA?
Mark, this would appear to be a candidate for 3.0.3. Ok?
r~
* except.c (sjlj_find_directly_reachable_regions): Don't
consider RNL_BLOCKED a directly reachable region.
(sjlj_assign_call_site_values): Trust directly_reachable.
(sjlj_emit_dispatch_table): Likewise.
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.143.2.17
diff -u -p -r1.143.2.17 except.c
--- except.c 2001/09/17 23:12:47 1.143.2.17
+++ except.c 2001/12/11 22:55:08
@@ -1948,6 +1948,7 @@ sjlj_find_directly_reachable_regions (lp
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
{
struct eh_region *region;
+ enum reachable_code rc;
tree type_thrown;
rtx note;
@@ -1969,11 +1970,14 @@ sjlj_find_directly_reachable_regions (lp
/* Find the first containing region that might handle the exception.
That's the landing pad to which we will transfer control. */
+ rc = RNL_NOT_CAUGHT;
for (; region; region = region->outer)
- if (reachable_next_level (region, type_thrown, 0) != RNL_NOT_CAUGHT)
- break;
-
- if (region)
+ {
+ rc = reachable_next_level (region, type_thrown, 0);
+ if (rc != RNL_NOT_CAUGHT)
+ break;
+ }
+ if (rc == RNL_MAYBE_CAUGHT || rc == RNL_CAUGHT)
{
lp_info[region->region_number].directly_reachable = 1;
found_one = true;
@@ -2020,8 +2024,7 @@ sjlj_assign_call_site_values (dispatch_l
index = 0;
for (i = cfun->eh->last_region_number; i > 0; --i)
- if (lp_info[i].directly_reachable
- && lp_info[i].action_index >= 0)
+ if (lp_info[i].directly_reachable)
lp_info[i].dispatch_index = index++;
/* Finally: assign call-site values. If dwarf2 terms, this would be
@@ -2302,8 +2305,7 @@ sjlj_emit_dispatch_table (dispatch_label
first_reachable = 0;
for (i = cfun->eh->last_region_number; i > 0; --i)
{
- if (! lp_info[i].directly_reachable
- || lp_info[i].action_index < 0)
+ if (! lp_info[i].directly_reachable)
continue;
if (! first_reachable)