Commit 100d81d4 by Jason Merrill Committed by Jason Merrill

except.c (call_get_eh_context): Don't mess with sequences.

	* except.c (call_get_eh_context): Don't mess with sequences.
	(emit_eh_context): Include the call in the sequence here.

From-SVN: r17070
parent cba734ea
Fri Dec 12 01:19:48 1997 Jason Merrill <jason@yorick.cygnus.com>
* except.c (call_get_eh_context): Don't mess with sequences.
(emit_eh_context): Include the call in the sequence here.
1997-12-11 Paul Eggert <eggert@twinsun.com> 1997-12-11 Paul Eggert <eggert@twinsun.com>
* collect2.c (write_c_file_glob): Allocate initial frame object * collect2.c (write_c_file_glob): Allocate initial frame object
......
...@@ -707,15 +707,13 @@ add_partial_entry (handler) ...@@ -707,15 +707,13 @@ add_partial_entry (handler)
pop_obstacks (); pop_obstacks ();
} }
/* Emit code to get EH context to current function. Should only be used /* Emit code to get EH context to current function. */
by emit_eh_context. */
static rtx static rtx
call_get_eh_context () call_get_eh_context ()
{ {
static tree fn; static tree fn;
tree expr; tree expr;
rtx ehc, reg, insns;
if (fn == NULL_TREE) if (fn == NULL_TREE)
{ {
...@@ -741,16 +739,7 @@ call_get_eh_context () ...@@ -741,16 +739,7 @@ call_get_eh_context ()
expr, NULL_TREE, NULL_TREE); expr, NULL_TREE, NULL_TREE);
TREE_SIDE_EFFECTS (expr) = 1; TREE_SIDE_EFFECTS (expr) = 1;
start_sequence (); return copy_to_reg (expand_expr (expr, NULL_RTX, VOIDmode, 0));
ehc = expand_expr (expr, NULL_RTX, VOIDmode, 0);
reg = copy_to_reg (ehc);
insns = get_insns ();
end_sequence ();
emit_insns_before (insns, get_first_nonparm_insn ());
return reg;
} }
/* Get a reference to the EH context. /* Get a reference to the EH context.
...@@ -1678,11 +1667,12 @@ emit_eh_context () ...@@ -1678,11 +1667,12 @@ emit_eh_context ()
{ {
rtx insns; rtx insns;
/* If this is the first use insn, emit the call. */ start_sequence ();
/* If this is the first use insn, emit the call here. */
if (ehc == 0) if (ehc == 0)
ehc = call_get_eh_context (); ehc = call_get_eh_context ();
start_sequence ();
emit_move_insn (XEXP (reg, 0), ehc); emit_move_insn (XEXP (reg, 0), ehc);
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
......
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