aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-12-03 15:58:44 -0800
committerRichard Henderson <rth@gcc.gnu.org>2000-12-03 15:58:44 -0800
commit250d07b61f2772c7b4b35bbb8f8839fd77a1b8bc (patch)
tree0c8d554434d79763f71c942c0611cca67f9922f0 /gcc/except.c
parent2702080f01f7aa733242b804de2d11f202b34276 (diff)
downloadgcc-250d07b61f2772c7b4b35bbb8f8839fd77a1b8bc.zip
gcc-250d07b61f2772c7b4b35bbb8f8839fd77a1b8bc.tar.gz
gcc-250d07b61f2772c7b4b35bbb8f8839fd77a1b8bc.tar.bz2
bb-reorder.c (reorder_basic_blocks): Don't check for EH edges unless exception handling is enabled...
* bb-reorder.c (reorder_basic_blocks): Don't check for EH edges unless exception handling is enabled, and if not using sjlj. * builtins.c (expand_builtin_setjmp_setup): New. (expand_builtin_setjmp_receiver): New. (expand_builtin_setjmp): Split out _setup and _receiver functions. Move argument parsing in from ... (expand_builtin): ... here. * except.c (receive_exception_label): Branch around receiver unless new-style exceptions. Call expand_builtin_setjmp_receiver. (start_dynamic_handler): Call expand_builtin_setjmp_setup. * expr.h: Update builtin setjmp decls. From-SVN: r37982
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c57
1 files changed, 38 insertions, 19 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 5364b25..c1dd0cb 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -672,19 +672,40 @@ static void
receive_exception_label (handler_label)
rtx handler_label;
{
+ rtx around_label = NULL_RTX;
+
+ if (! flag_new_exceptions || exceptions_via_longjmp)
+ {
+ around_label = gen_label_rtx ();
+ emit_jump (around_label);
+ emit_barrier ();
+ }
+
emit_label (handler_label);
-#ifdef HAVE_exception_receiver
if (! exceptions_via_longjmp)
- if (HAVE_exception_receiver)
- emit_insn (gen_exception_receiver ());
+ {
+#ifdef HAVE_exception_receiver
+ if (HAVE_exception_receiver)
+ emit_insn (gen_exception_receiver ());
+ else
#endif
-
#ifdef HAVE_nonlocal_goto_receiver
- if (! exceptions_via_longjmp)
- if (HAVE_nonlocal_goto_receiver)
- emit_insn (gen_nonlocal_goto_receiver ());
+ if (HAVE_nonlocal_goto_receiver)
+ emit_insn (gen_nonlocal_goto_receiver ());
+ else
#endif
+ { /* Nothing */ }
+ }
+ else
+ {
+#ifndef DONT_USE_BUILTIN_SETJMP
+ expand_builtin_setjmp_receiver (handler_label);
+#endif
+ }
+
+ if (around_label)
+ emit_label (around_label);
}
@@ -1304,7 +1325,7 @@ static void
start_dynamic_handler ()
{
rtx dhc, dcc;
- rtx x, arg, buf;
+ rtx arg, buf;
int size;
#ifndef DONT_USE_BUILTIN_SETJMP
@@ -1351,19 +1372,17 @@ start_dynamic_handler ()
buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);
#ifdef DONT_USE_BUILTIN_SETJMP
- x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
- TYPE_MODE (integer_type_node), 1,
- buf, Pmode);
- /* If we come back here for a catch, transfer control to the handler. */
- jumpif_rtx (x, ehstack.top->entry->exception_handler_label);
-#else
{
- /* A label to continue execution for the no exception case. */
- rtx noex = gen_label_rtx();
- x = expand_builtin_setjmp (buf, NULL_RTX, noex,
- ehstack.top->entry->exception_handler_label);
- emit_label (noex);
+ rtx x;
+ x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
+ TYPE_MODE (integer_type_node), 1,
+ buf, Pmode);
+ /* If we come back here for a catch, transfer control to the handler. */
+ jumpif_rtx (x, ehstack.top->entry->exception_handler_label);
}
+#else
+ expand_builtin_setjmp_setup (buf,
+ ehstack.top->entry->exception_handler_label);
#endif
/* We are committed to this, so update the handler chain. */