diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-04-06 00:51:25 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-04-06 00:51:25 +0000 |
commit | bedda2da7f0434c931864fd1860d8b49106733bb (patch) | |
tree | e86a0b0c8611c92ba993e13102ca5e6b62015c94 /gcc/function.c | |
parent | e0fc4118fea69036438dc790c529a68e183f24fe (diff) | |
download | gcc-bedda2da7f0434c931864fd1860d8b49106733bb.zip gcc-bedda2da7f0434c931864fd1860d8b49106733bb.tar.gz gcc-bedda2da7f0434c931864fd1860d8b49106733bb.tar.bz2 |
final.c (final): Use xcalloc to allocate line_note_exists.
* final.c (final): Use xcalloc to allocate line_note_exists.
* function.c (free_after_compilation): Free the temp_slots.
(assign_stack_temp_for_type): Use xmalloc to allocate temp_slots.
(combine_temp_slot): Free temp_slots when they get combined.
(purge_addressof): Fix typo in comment.
* stmt.c (mark_goto_fixup): Mark the fixup itself.
(expand_fixup): Allocate the fixup with ggc_alloc_obj.
* ggc.h: Include varray.h.
(ggc_pending_trees): Declare.
(ggc_mark_tree_children): Remove declaration.
(ggc_mark_tree): Just push unmarked trees on ggc_pending_trees.
* ggc-common.c (ggc_pending_trees): New variable.
(ggc_mark_roots): Call ggc_mark_trees.
(ggc_mark_tree_children): Rename to ggc_mark_trees. Process all
the ggc_pending_trees.
* Makefile.in (GGC_H): New variable. Use it throughout in place
of ggc.h.
* Makefile.in (GGC_H): New variable. Use it throughout in place
of ggc.h.
* call.c: Don't include obstack.h. Include ggc.h.
(obstack_chunk_alloc): Don't define.
(obstack_chunk_free): Likewise.
(add_candidate): Allocate the z_candidate with ggc_alloc_obj.
* decl.c (push_switch): Use xmalloc to allocate the cp_switch.
(pop_switch): Free it.
* decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs.
* dump.c (dequeue_and_dump): Don't try to print the bit_position
if we don't have a DECL_FIELD_OFFSET.
* Makefile.in (GGC_H): Add varray.h.
From-SVN: r32956
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/function.c b/gcc/function.c index b6265f3..b17f360 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -445,6 +445,9 @@ void free_after_compilation (f) struct function *f; { + struct temp_slot *ts; + struct temp_slot *next; + free_eh_status (f); free_expr_status (f); free_emit_status (f); @@ -456,6 +459,13 @@ free_after_compilation (f) if (f->x_parm_reg_stack_loc) free (f->x_parm_reg_stack_loc); + for (ts = f->x_temp_slots; ts; ts = next) + { + next = ts->next; + free (ts); + } + f->x_temp_slots = NULL; + f->arg_offset_rtx = NULL; f->return_rtx = NULL; f->internal_arg_pointer = NULL; @@ -476,7 +486,6 @@ free_after_compilation (f) f->x_parm_birth_insn = NULL; f->x_last_parm_insn = NULL; f->x_parm_reg_stack_loc = NULL; - f->x_temp_slots = NULL; f->fixup_var_refs_queue = NULL; f->original_arg_vector = NULL; f->original_decl_initial = NULL; @@ -714,7 +723,7 @@ assign_stack_temp_for_type (mode, size, keep, type) if (best_p->size - rounded_size >= alignment) { - p = (struct temp_slot *) oballoc (sizeof (struct temp_slot)); + p = (struct temp_slot *) xmalloc (sizeof (struct temp_slot)); p->in_use = p->addr_taken = 0; p->size = best_p->size - rounded_size; p->base_offset = best_p->base_offset + rounded_size; @@ -744,7 +753,7 @@ assign_stack_temp_for_type (mode, size, keep, type) { HOST_WIDE_INT frame_offset_old = frame_offset; - p = (struct temp_slot *) oballoc (sizeof (struct temp_slot)); + p = (struct temp_slot *) xmalloc (sizeof (struct temp_slot)); /* We are passing an explicit alignment request to assign_stack_local. One side effect of that is assign_stack_local will not round SIZE @@ -935,7 +944,10 @@ combine_temp_slots () } /* Either delete Q or advance past it. */ if (delete_q) - prev_q->next = q->next; + { + prev_q->next = q->next; + free (q); + } else prev_q = q; } @@ -3274,7 +3286,7 @@ purge_addressof (insns) /* When we actually purge ADDRESSOFs, we turn REGs into MEMs. That requires a fixup pass over the instruction stream to correct INSNs that depended on the REG being a REG, and not a MEM. But, - these fixup passes are slow. Furthermore, more MEMs are not + these fixup passes are slow. Furthermore, most MEMs are not mentioned in very many instructions. So, we speed up the process by pre-calculating which REGs occur in which INSNs; that allows us to perform the fixup passes much more quickly. */ |