Commit 843e8335 by Mike Stump

libgcc2.c (__throw): New routine.

        * libgcc2.c (__throw): New routine.
        (__eh_pc): New data object for exception handling.

        * except.c (eh_saved_pc): New object so we can call
        assemble_external.
        (expand_internal_throw_indirect): Call assemble_external for
        __eh_pc.
        (end_eh_unwinder): Ditto.
        (init_eh): Initialize eh_saved_pc.
fixes eh6.C on rs6000 and alpha

From-SVN: r12646
parent 6a5d7526
...@@ -165,9 +165,10 @@ struct label_node *caught_return_label_stack = NULL; ...@@ -165,9 +165,10 @@ struct label_node *caught_return_label_stack = NULL;
struct label_node *false_label_stack = NULL; struct label_node *false_label_stack = NULL;
/* The rtx for the saved PC value. */ /* The rtx and the tree for the saved PC value. */
rtx eh_saved_pc_rtx; rtx eh_saved_pc_rtx;
tree eh_saved_pc;
rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx)); rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx));
...@@ -450,6 +451,7 @@ void ...@@ -450,6 +451,7 @@ void
expand_internal_throw_indirect (context) expand_internal_throw_indirect (context)
rtx context; rtx context;
{ {
assemble_external (eh_saved_pc);
emit_move_insn (eh_saved_pc_rtx, context); emit_move_insn (eh_saved_pc_rtx, context);
emit_throw (); emit_throw ();
} }
...@@ -759,6 +761,8 @@ end_eh_unwinder () ...@@ -759,6 +761,8 @@ end_eh_unwinder ()
return; return;
#endif #endif
assemble_external (eh_saved_pc);
expr = make_node (RTL_EXPR); expr = make_node (RTL_EXPR);
TREE_TYPE (expr) = void_type_node; TREE_TYPE (expr) = void_type_node;
RTL_EXPR_RTL (expr) = const0_rtx; RTL_EXPR_RTL (expr) = const0_rtx;
...@@ -955,8 +959,13 @@ check_exception_handler_labels () ...@@ -955,8 +959,13 @@ check_exception_handler_labels ()
void void
init_eh () init_eh ()
{ {
eh_saved_pc_rtx = gen_rtx (MEM, ptr_mode, tree type = build_pointer_type (make_node (VOID_TYPE));
gen_rtx (SYMBOL_REF, Pmode, "__eh_pc"));
eh_saved_pc = build_decl (VAR_DECL, get_identifier ("__eh_pc"), type);
DECL_EXTERNAL (eh_saved_pc) = 1;
TREE_PUBLIC (eh_saved_pc) = 1;
make_decl_rtl (eh_saved_pc, NULL_PTR, 1);
eh_saved_pc_rtx = DECL_RTL (eh_saved_pc);
} }
/* Initialize various EH things. */ /* Initialize various EH things. */
......
...@@ -3149,6 +3149,21 @@ __throw_type_match (void *catch_type, void *throw_type, void *obj) ...@@ -3149,6 +3149,21 @@ __throw_type_match (void *catch_type, void *throw_type, void *obj)
return 0; return 0;
} }
/* Throw stub routine.
This is work in progress, but not completed yet. */
void
__throw ()
{
abort ();
}
/* This value identifies the place from which an exception is being
thrown. */
void *__eh_pc;
void void
__empty () __empty ()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment