From 21cd906efe356578356ec1c36841629951681b44 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 7 Sep 1999 15:20:58 +0000 Subject: emit-rtl.c (free_emit_status): Take decl as a parameter. * emit-rtl.c (free_emit_status): Take decl as a parameter. (init_emit_once): Add more GC roots. * except.c (mark_func_eh_entry): New function. (mark_eh_node): Mark false_label and rethrow_label. (init_eh): Add more GC roots. * function.c (free_after_compilation): Take decl as a paramter. Call free_stmt_status. (mark_function_state): Don't assume x_parm_reg_stack_loc is non-NULL. * function.h (free_after_compilation): Change prototype. (free_varasm_status): Likewise. (free_emit_status): Likewise. (free_stmt_status): New function. * ggc-simple.c (rtx, vecs, trees, strings, bytes_alloced_since_gc): Remove, replacing with ... (ggc_status): New structure. (ggc_chain): New variable. (init_gcc): Define. (ggc_push_context): New function. (ggc_pop_context): Likewise. (ggc_alloc_rtx): Adjust for use of ggc_chain. (ggc_alloc_rtvec): Likewise. (ggc_alloc_tree): Likewise. (ggc_alloc_string): Likewise. (ggc_mark_rtx): Mark NOTE_SOURCE_FILE and NOTE_RANGE_INFO. (ggc_mark_tree): Give language-dependent code a chance to mark `x' nodes. (ggc_mark_tree_varray): Handle empty arrays. (ggc_collect): Adjust for use of ggc_chain. Clear bytes_alloced_since_last_gc. * ggc.h (ggc_pop_context): New function. (ggc_push_context): Likewise. * print-tree.c (print_node): Don't print obstacks when GC'ing. * stmt.c (free_stmt_status): New function. (init_stmt_for_function): Clear last_expr_value. * toplev.c (rest_of_compilation): Always call free_after_compilation. Conditionalize call to ggc_collect. (main): Call init_ggc. * tree.c (push_obstacks): Do the push, even when GC'ing. (push_obstacks_nochange): Likewise. (pop_obstacks): Liekwise. * varasm.c (free_varasm_status): Take decl as a parameter. From-SVN: r29170 --- gcc/except.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'gcc/except.c') diff --git a/gcc/except.c b/gcc/except.c index 0548006..4bb2adb 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -472,6 +472,7 @@ static void mark_eh_node PROTO((struct eh_node *)); static void mark_eh_stack PROTO((struct eh_stack *)); static void mark_eh_queue PROTO((struct eh_queue *)); static void mark_tree_label_node PROTO ((struct label_node *)); +static void mark_func_eh_entry PROTO ((void *)); rtx expand_builtin_return_addr PROTO((enum built_in_function, int, rtx)); @@ -2347,6 +2348,8 @@ mark_eh_node (node) ggc_mark_rtx (node->entry->outer_context); ggc_mark_rtx (node->entry->exception_handler_label); ggc_mark_tree (node->entry->finalization); + ggc_mark_rtx (node->entry->false_label); + ggc_mark_rtx (node->entry->rethrow_label); } node = node ->chain; } @@ -2405,6 +2408,33 @@ mark_eh_state (eh) ggc_mark_rtx (eh->x_eh_return_stub_label); } +/* Mark ARG (which is really a struct func_eh_entry**) for GC. */ + +static void +mark_func_eh_entry (arg) + void *arg; +{ + struct func_eh_entry *fee; + struct handler_info *h; + int i; + + fee = *((struct func_eh_entry **) arg); + + for (i = 0; i < current_func_eh_entry; ++i) + { + ggc_mark_rtx (fee->rethrow_label); + for (h = fee->handlers; h; h = h->next) + { + ggc_mark_rtx (h->handler_label); + if (h->type_info != CATCH_ALL_TYPE) + ggc_mark_tree ((tree) h->type_info); + } + + /* Skip to the next entry in the array. */ + ++fee; + } +} + /* This group of functions initializes the exception handling data structures at the start of the compilation, initializes the data structures at the start of a function, and saves and restores the @@ -2419,8 +2449,18 @@ init_eh () first_rethrow_symbol = create_rethrow_ref (0); final_rethrow = gen_exception_label (); last_rethrow_symbol = create_rethrow_ref (CODE_LABEL_NUMBER (final_rethrow)); -} + ggc_add_rtx_root (&exception_handler_labels, 1); + ggc_add_rtx_root (&eh_return_context, 1); + ggc_add_rtx_root (&eh_return_stack_adjust, 1); + ggc_add_rtx_root (&eh_return_handler, 1); + ggc_add_rtx_root (&first_rethrow_symbol, 1); + ggc_add_rtx_root (&final_rethrow, 1); + ggc_add_rtx_root (&last_rethrow_symbol, 1); + ggc_add_root (&function_eh_regions, 1, sizeof (function_eh_regions), + mark_func_eh_entry); +} + /* Initialize the per-function EH information. */ void -- cgit v1.1