aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-09-07 15:20:58 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-09-07 15:20:58 +0000
commit21cd906efe356578356ec1c36841629951681b44 (patch)
treeebef7e81648f072e4f956a33a801979f7a35c649 /gcc/function.c
parent498ffa68acb51d998126df401a801b8cdf55f152 (diff)
downloadgcc-21cd906efe356578356ec1c36841629951681b44.zip
gcc-21cd906efe356578356ec1c36841629951681b44.tar.gz
gcc-21cd906efe356578356ec1c36841629951681b44.tar.bz2
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
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/function.c b/gcc/function.c
index b83a7c4..4ce2dd5 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -390,17 +390,23 @@ pop_function_context ()
/* 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_after_compilation (f)
+free_after_compilation (f, d)
struct function *f;
+ tree d;
{
- free_emit_status (f);
- free_varasm_status (f);
-
- free (f->x_parm_reg_stack_loc);
+ free_emit_status (f, d);
+ free_varasm_status (f, d);
+ free_stmt_status (f, d);
- f->can_garbage_collect = 1;
+ if (!DECL_DEFER_OUTPUT (d))
+ {
+ free (f->x_parm_reg_stack_loc);
+ f->can_garbage_collect = 1;
+ }
}
/* Allocate fixed slots in the stack frame of the current function. */
@@ -6682,9 +6688,10 @@ mark_function_state (p)
ggc_mark_rtx (p->arg_offset_rtx);
- for (i = p->x_max_parm_reg, r = p->x_parm_reg_stack_loc;
- i > 0; --i, ++r)
- ggc_mark_rtx (*r);
+ if (p->x_parm_reg_stack_loc)
+ for (i = p->x_max_parm_reg, r = p->x_parm_reg_stack_loc;
+ i > 0; --i, ++r)
+ ggc_mark_rtx (*r);
ggc_mark_rtx (p->return_rtx);
ggc_mark_rtx (p->x_cleanup_label);