diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1997-12-05 03:06:17 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1997-12-04 22:06:17 -0500 |
commit | d07daca1e5d1cef8c5249be10ba0ed6809c38330 (patch) | |
tree | efe76946688e2757c1873863e5b29032902309f7 | |
parent | 0609f0216fce8319c76cefff768d82693d9c1d4d (diff) | |
download | gcc-d07daca1e5d1cef8c5249be10ba0ed6809c38330.zip gcc-d07daca1e5d1cef8c5249be10ba0ed6809c38330.tar.gz gcc-d07daca1e5d1cef8c5249be10ba0ed6809c38330.tar.bz2 |
except.c (get_dynamic_handler_chain): Only make the call once per function.
* except.c (get_dynamic_handler_chain): Only make the call once per
function.
From-SVN: r16955
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/except.c | 35 |
2 files changed, 18 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bccce41..da734b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Thu Dec 4 11:51:00 1997 Jason Merrill <jason@yorick.cygnus.com> + * except.c (get_dynamic_handler_chain): Only make the call once per + function. + * except.c (expand_end_all_catch): Fix for sjlj exceptions. Thu Dec 4 12:30:40 1997 J"orn Rennecke <amylaar@cygnus.co.uk> diff --git a/gcc/except.c b/gcc/except.c index 9a2f6a0..0e9e814 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -728,31 +728,20 @@ add_partial_entry (handler) This routine is here to facilitate the porting of this code to systems with threads. One can either replace the routine we emit a call for here in libgcc2.c, or one can modify this routine to work - with their thread system. */ + with their thread system. + + Ideally, we really only want one per real function, not one + per inlined function. */ rtx get_dynamic_handler_chain () { -#if 0 - /* Do this once we figure out how to get this to the front of the - function, and we really only want one per real function, not one - per inlined function. */ - if (current_function_dhc == 0) - { - rtx dhc, insns; - start_sequence (); - - /* ... */ - insns = get_insns (); - end_sequence (); - emit_insns_before (insns, get_first_nonparm_insn ()); - } - /* We don't want a copy of the dhc, but rather, the single dhc. */ - return gen_rtx (MEM, Pmode, current_function_dhc); -#endif - static tree fn; tree expr; + rtx insns; + + if (current_function_dhc) + return current_function_dhc; if (fn == NULL_TREE) { @@ -779,7 +768,13 @@ get_dynamic_handler_chain () TREE_SIDE_EFFECTS (expr) = 1; expr = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr)), expr); - return expand_expr (expr, NULL_RTX, VOIDmode, 0); + start_sequence (); + current_function_dhc = expand_expr (expr, NULL_RTX, VOIDmode, 0); + insns = get_insns (); + end_sequence (); + emit_insns_before (insns, get_first_nonparm_insn ()); + + return current_function_dhc; } /* Get a reference to the dynamic cleanup chain. It points to the |