From: mmitchel Date: Sun, 5 Sep 1999 19:54:38 +0000 (+0000) Subject: * Makefile.in (ggc-simple.o): Depend on varray.h. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=afdd6317caaeebbb72ee40b704c3e8643a71fea4 * 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. * gengenrtl.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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29131 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c index 762c96fa4e4..5a3211f64fe 100644 --- a/gcc/gengenrtl.c +++ b/gcc/gengenrtl.c @@ -242,7 +242,12 @@ gendef (f, format) /* See rtx_alloc in rtl.c for comments. */ fprintf (f, "{\n"); - fprintf (f, " rtx rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", + fprintf (f, " rtx rt;\n"); + fprintf (f, " if (ggc_p)\n"); + fprintf (f, " rt = ggc_alloc_rtx (%d);\n", + (int) strlen (format)); + fprintf (f, " else\n"); + fprintf (f, " rt = obstack_alloc_rtx (sizeof (struct rtx_def) + %d * sizeof (rtunion));\n", (int) strlen (format) - 1); fprintf (f, " PUT_CODE (rt, code);\n"); @@ -301,7 +306,8 @@ gencode (f) fputs ("#include \"config.h\"\n", f); fputs ("#include \"system.h\"\n", f); fputs ("#include \"obstack.h\"\n", f); - fputs ("#include \"rtl.h\"\n\n", f); + fputs ("#include \"rtl.h\"\n", f); + fputs ("#include \"ggc.h\"\n\n", f); fputs ("extern struct obstack *rtl_obstack;\n\n", f); fputs ("static rtx obstack_alloc_rtx PROTO((int length));\n", f); fputs ("static rtx obstack_alloc_rtx (length)\n", f);