aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-09-05 09:08:20 -0700
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-09-05 16:08:20 +0000
commita3770a813002ceaedfe097ea46c8ddc09b9c289c (patch)
tree53f583f3f8569b93ca268331c1f771e401b63045 /gcc/function.c
parent616aeddaa175d5e70417df682d41ce8370bdeab2 (diff)
downloadgcc-a3770a813002ceaedfe097ea46c8ddc09b9c289c.zip
gcc-a3770a813002ceaedfe097ea46c8ddc09b9c289c.tar.gz
gcc-a3770a813002ceaedfe097ea46c8ddc09b9c289c.tar.bz2
Makefile.in (ggc-simple.o): Depend on varray.h.
* Makefile.in (ggc-simple.o): Depend on varray.h. (rtl.o): Depend on ggc.h. (genattrtab.o): Depend on ggc.h. (print-tree.o): Likewise. (fold-const.o): Likewise. * emit-rtl.c (sequence_element_free_list): Remove, and all references. (make_insn_raw): Don't cache insns when GC'ing. (emit_insn_before): Likewise. (emit_insn_after): Likewise. (emit_insn): Likewise. (start_sequence): Use xmalloc to allocate the sequence_stack. (end_sequence): Add free to free it. (gen_sequence): Don't cache insns when GC'ing. (clear_emit_caches): Don't use sequence_element_free_list. (init_emit): Use xcalloc, not xmalloc+bzero. * fold-const.c (size_int_wide): Kill the cache, when GC'ing. * function.c (pop_function_context_from): Use free to free the fixup_var_refs_queue. (put_reg_into_stack): Allocate it with xmalloc. * genattrtab.c: Include ggc.h. (operate_exp): Don't use obstack_free when GC'ing. (simplify_cond): Likewise. (simplify_text_exp): Likewise. (optimize_attrs): Likewise. * gengentrtl.c (gendef): Use ggc_alloc_rtx to allocate RTL, when GC'ing. (gencode): Generate a #include for ggc.h. * ggc-callbacks.c (ggc_p): Define it to zero. * ggc-none.c (ggc_p): Likewise. * ggc-simple.c: Include varray.h. (ggc_mark_tree_varray): New function. (ggc_add_tree_varray_root): Likewise. (ggc_mark_tree_varray_ptr): Likewise. * ggc.h (ggc_p): Declare. (varray_head_tag): Likewise. (ggc_add_tree_varray_root): Declare. * print-tree.c (print_node): Don't check for TREE_PERMANENT inconsistencies when GC'ing. * rtl.c: Include ggc.h. (rtvec_alloc): Use ggc_alloc_rtvec when GC'ing. (rtx_alloc): Use ggc_alloc_rtx when GC'ing. (rtx_free): Don't call obstack_free when GC'ing. * toplev.c (rest_of_compilation): Call ggc_collect after every pass, if GC'ing. * tree.c (push_obstacks): Do nothing, if GC'ing. (pop_obstacks_nochange): Likewise. (pop_obstacks): Likewise. (make_node): Use ggc_alloc_tree when GC'ing. (copy_node): Likewise. (get_identifier): Use ggc_alloc_string when GC'ing. (build_string): Likewise. (make_tree_vec): Use ggc_alloc_tree when GC'ing. (tree_cons): Likewise. (build1): Likewise. (type_hash_canon): Don't call obstack_free when GC'ing. Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk> Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r29125
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/function.c b/gcc/function.c
index b0c2725..960b660 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -350,6 +350,7 @@ pop_function_context_from (context)
{
struct function *p = outer_function_chain;
struct var_refs_queue *queue;
+ struct var_refs_queue *next;
current_function = p;
outer_function_chain = p->next;
@@ -367,9 +368,14 @@ pop_function_context_from (context)
/* Finish doing put_var_into_stack for any of our variables
which became addressable during the nested function. */
- for (queue = p->fixup_var_refs_queue; queue; queue = queue->next)
- fixup_var_refs (queue->modified, queue->promoted_mode,
- queue->unsignedp, 0);
+ for (queue = p->fixup_var_refs_queue; queue; queue = next)
+ {
+ next = queue->next;
+ fixup_var_refs (queue->modified, queue->promoted_mode,
+ queue->unsignedp, 0);
+ free (queue);
+ }
+ p->fixup_var_refs_queue = 0;
/* Reset variables that have known state during rtx generation. */
rtx_equal_function_value_matters = 1;
@@ -1337,20 +1343,13 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
{
struct var_refs_queue *temp;
- /* Variable is inherited; fix it up when we get back to its function. */
- push_obstacks (function->function_obstack,
- function->function_maybepermanent_obstack);
-
- /* See comment in restore_tree_status in tree.c for why this needs to be
- on saveable obstack. */
temp
- = (struct var_refs_queue *) savealloc (sizeof (struct var_refs_queue));
+ = (struct var_refs_queue *) xmalloc (sizeof (struct var_refs_queue));
temp->modified = reg;
temp->promoted_mode = promoted_mode;
temp->unsignedp = TREE_UNSIGNED (type);
temp->next = function->fixup_var_refs_queue;
function->fixup_var_refs_queue = temp;
- pop_obstacks ();
}
else if (used_p)
/* Variable is local; fix it up now. */