aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1997-12-04 09:41:38 +0000
committerJason Merrill <jason@gcc.gnu.org>1997-12-04 04:41:38 -0500
commite701eb4de0b60d5ceac3ec4d9be03f7e39a57103 (patch)
tree952b95458e119610c40fb72e6d852f3a40843ba5 /gcc/cp
parenta1e343dd7a3f537a038c3903264fa41f9c4df29d (diff)
downloadgcc-e701eb4de0b60d5ceac3ec4d9be03f7e39a57103.zip
gcc-e701eb4de0b60d5ceac3ec4d9be03f7e39a57103.tar.gz
gcc-e701eb4de0b60d5ceac3ec4d9be03f7e39a57103.tar.bz2
./: * libgcc2.c (__throw): Use __builtin_return_addr instead of __eh_pc.
* except.c: Lose outer_context_label_stack. (expand_eh_region_end): Rethrow from outer_context here. (expand_fixup_region_end): Let expand_eh_region_end do the rethrow. (expand_internal_throw): Take no args. (expand_internal_throw_indirect): Lose. (expand_leftover_cleanups, expand_start_all_catch): Use expand_rethrow. (expand_start_all_catch): Start a rethrow region. (expand_end_all_catch): End it. (expand_rethrow): New fn. * except.h: Reflect above changes. cp/: * except.c (expand_end_catch_block): Lose rethrow region. (expand_start_catch_block): Likewise. (expand_end_catch_block): Don't expand_leftover_cleanups. From-SVN: r16937
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/except.c54
2 files changed, 12 insertions, 48 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 387c9d7..6b9737d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+Wed Dec 3 20:02:39 1997 Jason Merrill <jason@yorick.cygnus.com>
+
+ * except.c (expand_end_catch_block): Lose rethrow region.
+ (expand_start_catch_block): Likewise.
+ (expand_end_catch_block): Don't expand_leftover_cleanups.
+
Wed Dec 3 13:24:04 1997 Benjamin Kosnik <bkoz@rhino.cygnus.com>
* pt.c (tsubst): Remove tree_cons call (places redundant info into
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 6e7c876..194c17d 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -185,10 +185,13 @@ static tree Unwind;
========================================================================= */
+#ifndef DWARF2_UNWIND_INFO
/* Holds the pc for doing "throw" */
static tree saved_pc;
extern int throw_used;
+#endif
+
extern rtx catch_clauses;
extern tree const_ptr_type_node;
@@ -255,12 +258,14 @@ init_exception_processing ()
pop_lang_context ();
+#ifndef DWARF2_UNWIND_INFO
d = build_decl (VAR_DECL, get_identifier ("__eh_pc"), ptr_type_node);
TREE_PUBLIC (d) = 1;
DECL_EXTERNAL (d) = 1;
DECL_ARTIFICIAL (d) = 1;
cp_finish_decl (d, NULL_TREE, NULL_TREE, 0, 0);
saved_pc = d;
+#endif
/* If we use setjmp/longjmp EH, arrange for all cleanup actions to
be protected with __terminate. */
@@ -520,17 +525,6 @@ expand_start_catch_block (declspecs, declarator)
if (! doing_eh (1))
return;
- /* If we are not doing setjmp/longjmp EH, because we are reordered
- out of line, we arrange to rethrow in the outer context so as to
- skip through the terminate region we are nested in, should we
- encounter an exception in the catch handler. We also need to do
- this because we are not physically within the try block, if any,
- that contains this catch block.
-
- Matches the end in expand_end_catch_block. */
- if (! exceptions_via_longjmp)
- expand_eh_region_start ();
-
/* Create a binding level for the eh_info and the exception object
cleanup. */
pushlevel (0);
@@ -655,36 +649,11 @@ expand_end_catch_block ()
expand_end_bindings (getdecls (), kept_level_p (), 0);
poplevel (kept_level_p (), 1, 0);
- if (! exceptions_via_longjmp)
- {
- /* If we are not doing setjmp/longjmp EH, we need an extra
- region around the whole catch block to skip through the
- terminate region we are nested in. */
-
- tree t = make_node (RTL_EXPR);
- TREE_TYPE (t) = void_type_node;
- RTL_EXPR_RTL (t) = const0_rtx;
- TREE_SIDE_EFFECTS (t) = 1;
- do_pending_stack_adjust ();
- start_sequence_for_rtl_expr (t);
-
- expand_internal_throw (outer_context_label_stack->u.rlabel);
-
- do_pending_stack_adjust ();
- RTL_EXPR_SEQUENCE (t) = get_insns ();
- end_sequence ();
-
- /* For the rethrow region. */
- expand_eh_region_end (t);
- }
-
/* Fall to outside the try statement when done executing handler and
we fall off end of handler. This is jump Lresume in the
documentation. */
expand_goto (top_label_entry (&caught_return_label_stack));
- expand_leftover_cleanups ();
-
/* label we emit to jump to if this catch block didn't match. */
/* This the closing } in the `if (eq) {' of the documentation. */
emit_label (pop_label_entry (&false_label_stack));
@@ -1318,18 +1287,7 @@ expand_throw (exp)
expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
- if (exceptions_via_longjmp)
- emit_throw ();
- else
- {
- /* This is the label that represents where in the code we were, when
- we got an exception. This needs to be updated when we rethrow an
- exception, so that the matching routine knows to search out. */
- label = gen_label_rtx ();
- emit_label (label);
-
- expand_internal_throw (label);
- }
+ expand_internal_throw ();
}
/* Build a throw expression. */