emit-rtl.c (push_to_full_sequence, [...]): New functions.

* emit-rtl.c (push_to_full_sequence, end_full_sequence): New functions.
	* except.c (emit_cleanup_handler): Use them.
	(expand_end_all_catch): Likewise.
	* function.c (fixup_var_refs): Likewise.
	(expand_function_end): Clear catch_clauses_last.
	* rtl.h (push_to_full_sequence, end_full_sequence): Declare.
	* except.h (struct eh_status): New field x_catch_clauses_last.
	(catch_clauses_last): New define.

	* cp/except.c (expand_exception_blocks): Clear catch_clauses_last.

	* java/except.c (emit_handlers): Clear catch_clauses_last.

From-SVN: r32643
This commit is contained in:
Martin v. Löwis 2000-03-19 18:25:27 +00:00 committed by Martin v. Löwis
parent d88f311b63
commit c14f7160a1
10 changed files with 59 additions and 13 deletions

View File

@ -1,4 +1,13 @@
2000-03-18 Martin v. Löwis <loewis@informatik.hu-berlin.de>
2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* emit-rtl.c (push_to_full_sequence, end_full_sequence): New functions.
* except.c (emit_cleanup_handler): Use them.
(expand_end_all_catch): Likewise.
* function.c (fixup_var_refs): Likewise.
(expand_function_end): Clear catch_clauses_last.
* rtl.h (push_to_full_sequence, end_full_sequence): Declare.
* except.h (struct eh_status): New field x_catch_clauses_last.
(catch_clauses_last): New define.
* Makefile.in (tree.o): Depend on HASHTAB_H.
* tree.c: Include hashtab.h.

View File

@ -1,3 +1,7 @@
2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* except.c (expand_exception_blocks): Clear catch_clauses_last.
2000-03-18 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro.

View File

@ -796,13 +796,13 @@ expand_exception_blocks ()
expand_eh_region_start ();
emit_insns (catch_clauses);
catch_clauses = NULL_RTX;
catch_clauses = catch_clauses_last = NULL_RTX;
if (exceptions_via_longjmp == 0)
expand_eh_region_end (build_terminate_handler ());
emit_insns (catch_clauses);
catch_clauses = NULL_RTX;
catch_clauses = catch_clauses_last = NULL_RTX;
emit_label (funcend);
}
}

View File

@ -3422,6 +3422,20 @@ push_to_sequence (first)
last_insn = last;
}
/* Set up the insn chain from a chain stort in FIRST to LAST. */
void
push_to_full_sequence (first, last)
rtx first, last;
{
start_sequence ();
first_insn = first;
last_insn = last;
/* We really should have the end of the insn chain here. */
if (last && NEXT_INSN (last))
abort ();
}
/* Set up the outer-level insn chain
as the current sequence, saving the previously current one. */
@ -3484,6 +3498,18 @@ end_sequence ()
free (tem);
}
/* This works like end_sequence, but records the old sequence in FIRST
and LAST. */
void
end_full_sequence (first, last)
rtx *first, *last;
{
*first = first_insn;
*last = last_insn;
end_sequence();
}
/* Return 1 if currently emitting into a sequence. */
int

View File

@ -1865,10 +1865,9 @@ emit_cleanup_handler (entry)
end_sequence ();
/* And add it to the CATCH_CLAUSES. */
push_to_sequence (catch_clauses);
push_to_full_sequence (catch_clauses, catch_clauses_last);
emit_insns (handler_insns);
catch_clauses = get_insns ();
end_sequence ();
end_full_sequence (&catch_clauses, &catch_clauses_last);
/* Now we've left the handler. */
pop_ehqueue ();
@ -1990,10 +1989,9 @@ expand_end_all_catch ()
pop_label_entry (&outer_context_label_stack);
/* Add the new sequence of catches to the main one for this function. */
push_to_sequence (catch_clauses);
push_to_full_sequence (catch_clauses, catch_clauses_last);
emit_insns (new_catch_clause);
catch_clauses = get_insns ();
end_sequence ();
end_full_sequence (&catch_clauses, &catch_clauses_last);
/* Here we fall through into the continuation code. */
}

View File

@ -120,6 +120,8 @@ struct eh_status
/* Insns for all of the exception handlers for the current function.
They are currently emitted by the frontend code. */
rtx x_catch_clauses;
/* End of exception handler insn sequence. */
rtx x_catch_clauses_last;
/* A random data area for the front end's own use. */
struct label_node *x_false_label_stack;
/* Keeps track of the label to resume to should one want to resume
@ -142,6 +144,7 @@ struct eh_status
#define catchstack (cfun->eh->x_catchstack)
#define ehqueue (cfun->eh->x_ehqueue)
#define catch_clauses (cfun->eh->x_catch_clauses)
#define catch_clauses_last (cfun->eh->x_catch_clauses_last)
#define false_label_stack (cfun->eh->x_false_label_stack)
#define caught_return_label_stack (cfun->eh->x_caught_return_label_stack)
#define protect_list (cfun->eh->x_protect_list)

View File

@ -1548,10 +1548,10 @@ fixup_var_refs (var, promoted_mode, unsignedp, ht)
}
/* Scan the catch clauses for exception handling too. */
push_to_sequence (catch_clauses);
push_to_full_sequence (catch_clauses, catch_clauses_last);
fixup_var_refs_insns (var, promoted_mode, unsignedp, catch_clauses,
0, 0);
end_sequence ();
end_full_sequence (&catch_clauses, &catch_clauses_last);
/* Scan sequences saved in CALL_PLACEHOLDERS too. */
for (insn = first_insn; insn; insn = NEXT_INSN (insn))
@ -6549,7 +6549,7 @@ expand_function_end (filename, line, end_bindings)
/* If there are any catch_clauses remaining, output them now. */
emit_insns (catch_clauses);
catch_clauses = NULL_RTX;
catch_clauses = catch_clauses_last = NULL_RTX;
/* If the above emitted any code, may sure we jump around it. */
if (last != get_last_insn ())
{

View File

@ -1,3 +1,7 @@
2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* except.c (emit_handlers): Clear catch_clauses_last.
Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* class.c (make_field_value): Properly handle sizes.

View File

@ -433,7 +433,7 @@ emit_handlers ()
emit_jump (funcend);
emit_insns (catch_clauses);
catch_clauses = NULL_RTX;
catch_clauses = catch_clauses_last = NULL_RTX;
expand_leftover_cleanups ();
emit_label (funcend);

View File

@ -1012,6 +1012,8 @@ extern rtx get_last_insn_anywhere PARAMS ((void));
extern void start_sequence PARAMS ((void));
extern void push_to_sequence PARAMS ((rtx));
extern void end_sequence PARAMS ((void));
extern void push_to_full_sequence PARAMS ((rtx, rtx));
extern void end_full_sequence PARAMS ((rtx*, rtx*));
extern rtx gen_sequence PARAMS ((void));
extern rtx immed_double_const PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode));
extern rtx force_const_mem PARAMS ((enum machine_mode, rtx));