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/emit-rtl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gcc/emit-rtl.c') diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 5a4b5f2..9837b68 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1607,13 +1607,19 @@ restore_emit_status (p) clear_emit_caches (); } -/* Clear out all parts of our state in F that can safely be discarded +/* Clear out all parts of the state in F that can safely be discarded after the function has been compiled, to let garbage collection - reclaim the memory. */ + reclaim the memory. D is the declaration for the function just + compiled. Its output may have been deferred. */ + void -free_emit_status (f) +free_emit_status (f, d) struct function *f; + tree d; { + if (DECL_DEFER_OUTPUT (d)) + return; + free (f->emit->x_regno_reg_rtx); free (f->emit->regno_pointer_flag); free (f->emit->regno_pointer_align); @@ -3693,6 +3699,7 @@ init_emit_once (line_numbers) ggc_add_rtx_root (&const_tiny_rtx[0][0], sizeof(const_tiny_rtx)/sizeof(rtx)); + ggc_add_rtx_root (&const_true_rtx, 1); ggc_add_rtx_root (&pic_offset_table_rtx, 1); ggc_add_rtx_root (&struct_value_rtx, 1); ggc_add_rtx_root (&struct_value_incoming_rtx, 1); -- cgit v1.1