Commit 86c99549 by Richard Henderson Committed by Richard Henderson

except.c (get_exception_pointer, [...]): Take a struct function.

        * except.c (get_exception_pointer, get_exception_filter): Take a
        struct function.  Update all callers.
        * except.h (get_exception_pointer): Update declaration.
        * expr.c (expand_expr): Update get_exception_pointer call.
        * integrate.c (expand_inline_function): Remap the exception pointer
        from callee to caller.

From-SVN: r43060
parent 27132e64
2001-06-08 Richard Henderson <rth@redhat.com>
* except.c (get_exception_pointer, get_exception_filter): Take a
struct function. Update all callers.
* except.h (get_exception_pointer): Update declaration.
* expr.c (expand_expr): Update get_exception_pointer call.
* integrate.c (expand_inline_function): Remap the exception pointer
from callee to caller.
2001-06-08 Mark Mitchell <mark@codesourcery.com>
* c-decl.c (grokdeclarator): Make the TREE_TYPE for declarations
......
......@@ -256,7 +256,7 @@ static tree lookup_type_for_runtime PARAMS ((tree));
static struct eh_region *expand_eh_region_end PARAMS ((void));
static rtx get_exception_filter PARAMS ((void));
static rtx get_exception_filter PARAMS ((struct function *));
static void collect_eh_region_array PARAMS ((void));
static void resolve_fixup_regions PARAMS ((void));
......@@ -720,9 +720,9 @@ expand_eh_region_end_cleanup (handler)
/* In case this cleanup involves an inline destructor with a try block in
it, we need to save the EH return data registers around it. */
data_save[0] = gen_reg_rtx (Pmode);
emit_move_insn (data_save[0], get_exception_pointer ());
emit_move_insn (data_save[0], get_exception_pointer (cfun));
data_save[1] = gen_reg_rtx (word_mode);
emit_move_insn (data_save[1], get_exception_filter ());
emit_move_insn (data_save[1], get_exception_filter (cfun));
expand_expr (handler, const0_rtx, VOIDmode, 0);
......@@ -951,13 +951,14 @@ expand_eh_region_end_fixup (handler)
within a handler. */
rtx
get_exception_pointer ()
get_exception_pointer (fun)
struct function *fun;
{
rtx exc_ptr = cfun->eh->exc_ptr;
if (! exc_ptr)
rtx exc_ptr = fun->eh->exc_ptr;
if (fun == cfun && ! exc_ptr)
{
exc_ptr = gen_reg_rtx (Pmode);
cfun->eh->exc_ptr = exc_ptr;
fun->eh->exc_ptr = exc_ptr;
}
return exc_ptr;
}
......@@ -966,13 +967,14 @@ get_exception_pointer ()
within a handler. */
static rtx
get_exception_filter ()
get_exception_filter (fun)
struct function *fun;
{
rtx filter = cfun->eh->filter;
if (! filter)
rtx filter = fun->eh->filter;
if (fun == cfun && ! filter)
{
filter = gen_reg_rtx (word_mode);
cfun->eh->filter = filter;
fun->eh->filter = filter;
}
return filter;
}
......@@ -2356,8 +2358,8 @@ finish_eh_generation ()
/* These registers are used by the landing pads. Make sure they
have been generated. */
get_exception_pointer ();
get_exception_filter ();
get_exception_pointer (cfun);
get_exception_filter (cfun);
/* Construct the landing pads. */
......
......@@ -137,7 +137,7 @@ extern rtx expand_builtin_dwarf_fp_regnum PARAMS ((void));
extern void expand_builtin_eh_return PARAMS ((tree, tree));
extern void expand_eh_return PARAMS ((void));
extern rtx get_exception_pointer PARAMS ((void));
extern rtx get_exception_pointer PARAMS ((struct function *));
struct function;
struct inline_remap;
......
......@@ -8827,7 +8827,7 @@ expand_expr (exp, target, tmode, modifier)
return expand_builtin_va_arg (TREE_OPERAND (exp, 0), type);
case EXC_PTR_EXPR:
return get_exception_pointer ();
return get_exception_pointer (cfun);
default:
return (*lang_expand_expr) (exp, original_target, tmode, modifier);
......
......@@ -1111,6 +1111,11 @@ expand_inline_function (fndecl, parms, target, ignore, type,
else
abort ();
/* Remap the exception handler data pointer from one to the other. */
temp = get_exception_pointer (inl_f);
if (temp)
map->reg_map[REGNO (temp)] = get_exception_pointer (cfun);
/* Initialize label_map. get_label_from_map will actually make
the labels. */
memset ((char *) &map->label_map[min_labelno], 0,
......
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