summaryrefslogtreecommitdiff
path: root/gcc/ggc-simple.c
Commit message (Collapse)AuthorAgeFilesLines
* * ggc-common.c: Update pre-function commentary.rth1999-10-301-0/+12
| | | | | | | | | | | | | * ggc-page.c: Likewise. (poison): Remove. (poison_pages): Use memset directly. (ggc_alloc_obj): Likewise. Use a different pattern than poison_pages. (ggc_collect): Poison before sweeping. * ggc-simple.c: Update pre-function commentary. (ggc_alloc_obj): Poison non-zeroed memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30275 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc.h (struct ggc_statistics): New type.mmitchel1999-10-291-0/+9
| | | | | | | | | | | | | | | | | | (ggc_get_size): New function. (ggc_print_statistics): Likewise. * ggc-common.c (ggc_stats): New variable. (ggc_mark_rtx_children): Keep statistics. (ggc_mark_tree_children): Likewise. (ggc_print_statistics): New function. * ggc-page.c (struct globals): Add bytes_mapped field. (alloc_anon): Update it. (release_pages): Likewise. (ggc_get_size): New function. (ggc_page_print_statistics): New function. * ggc-simple.c (ggc_get_size): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30251 138bc75d-0d04-0410-961f-82ee72b054a4
* Simplified GC interface and other goodies.rth1999-10-131-568/+304
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29946 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc.h (ggc_push_context): Fix comment.mmitchel1999-10-111-1/+69
| | | | | | | | | | | | | | | | | | | | (ggc_pop_context): Likewise. (mark_string_if_gcable): Likewise. * ggc-common.c (ggc_mark_rtx_children): Use ggc_mark_string_if_gcable. * ggc-page.c (ggc_lookup_page_table): New function. (ggc_allocated_p): Likewise. (mark_obj): Fix formatting. (ggc_mark_string_if_gcable): New function. * ggc-simple.c (ggc_allocated_strings): New variable. (ggc_strings_used): Likewise. (ggc_compare_addresses): New function. (ggc_pop_context): Pop the `any' memory too. (ggc_mark_string_if_gcable): New function. (ggc_collect): Initialize and tear down ggc_allocated_strings. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29897 138bc75d-0d04-0410-961f-82ee72b054a4
* Initialize empty_string in ggc-simple.crux1999-10-071-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29856 138bc75d-0d04-0410-961f-82ee72b054a4
* Include tm_p.h in ggc filesmeissner1999-10-051-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29825 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-none.c (ggc_alloc_rtvec): An rtvec is an array of rtx,law1999-10-041-1/+1
| | | | | | | | | not an array of rtunion. * gcc-page.c (ggc_alloc_rtvec): Similarly. * gcc-simple (ggc_free_rtvec): Similarly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29793 138bc75d-0d04-0410-961f-82ee72b054a4
* Various fixes for problems discovered stress-testing GC.samuel1999-09-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | * config/i386/i386.c (pic_label_name): Change to char pointer. (global_offset_table): New variable. (load_pic_register): Fill global_offset_table if it hasn't already been done. Allocate pic_label_name dynamically. * ggc.h (empty_string): New variable. * ggc-simple.c (empty_string): Likewise. (init_ggc): Allocate empty_string and add as root. * stmt.c (digit_strings): New variable. (init_stmt): Add last_block_end_note as root. Allocate and initialize digit_strings. (expand_asm_operands): Use empty_string and digit_string instead of string constants. * profile.c (init_arc_profiler): Allocate with ggc_alloc_string instead of xmalloc. (output_func_start_profiler): Likewise. * c-typeck.c (digest_init): Check if init is error_mark_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29575 138bc75d-0d04-0410-961f-82ee72b054a4
* Thu Sep 16 11:50:52 1999 Alex Samuel <samuel@codesourcery.com>rth1999-09-161-12/+1
| | | | | | | | | | | | | | | | | | | * ggc.h (ggc_root): Move to ggc-common.c. (roots): Remove. (ggc_mark_rtx, ggc_mark_tree): Change to macro. (ggc_mark_rtvec, ggc_mark_tree_varray): Declare extern. (ggc_mark_tree_hash_table, ggc_mark_string, ggc_mark): Likewise. (ggc_mark_roots, ggc_mark_rtx_children, ggc_mark_tree_children): New. * ggc-common.c (ggc_root): Move from ggc.h. (roots): Declare, static. (ggc_mark_rtx, ggc_mark_tree): Renamed to... (ggc_mark_rtx_children, ggc_mark_tree_children): Don't check for null or check/set mark bit. (ggc_mark_roots): New. * ggc-simple.c (ggc_collect): Call ggc_mark_roots. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29461 138bc75d-0d04-0410-961f-82ee72b054a4
* * aclocal.m4 (AC_GCC_C_LONG_DOUBLE): New macro.ghazi1999-09-151-0/+4
| | | | | | | | | | | * configure.in (AC_GCC_C_LONG_DOUBLE): Call it. * gansidecl.h (HAVE_LONG_DOUBLE): Define if gcc for stage2. * ggc-simple.c (HAVE_LONG_DOUBLE): Test before using long double. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29432 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-simple.c (ggc_pop_context): Fold outstanding bytes intorth1999-09-121-2/+4
| | | | | | | surrounding context. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29353 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright.rth1999-09-111-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29282 138bc75d-0d04-0410-961f-82ee72b054a4
* Alex Samuel <samuel@codesourcery.com>rth1999-09-111-389/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ggc.h (rtvec_def): Forward declare. (tree_node): Likewise. (ggc_root): Define. (roots): Declare. (ggc_set_mark_rtx): Add prototype. (ggc_set_mark_rtvec): Likewise. (ggc_set_mark_tree): Likewise. * ggc-simple.c (ggc_root): Don't define. (roots): Don't declare. (ggc_mark_rtx): Remove. (ggc_mark_rtvec): Likewise. (ggc_mark_tree): Likewise. (ggc_mark_varray): Likewise. (ggc_mark_tree_hash_table_entry): Likewise. (ggc_mark_tree_hash_table): Likewise. (ggc_set_mart_rtx): New function. (ggc_set_mark_rtvec): Likewise. (ggc_set_mark_tree): Likewise. (ggc_add_root): Remove. (ggc_add_rtx_root): Likewise. (ggc_remove_tree_root): Likewise. (ggc_add_string_root): Likewise. (ggc_add_tree_varray_root): Likewise. (ggc_add_tree_hash_table_root): Likewise. (ggc_del_root): Likewise. (ggc_mark_rtx_ptr): Likewise. (ggc_mark_tree_ptr): Likewise. (ggc_mark_string_ptr): Likewise. (ggc_mark_tree_varray_ptr): Likewise. (ggc_mark_tree_hash_table_ptr): Likewise. * ggc-common.c: New file. * Makefile.in (OBJS): Add ggc-common.o. (ggc-common.o): List dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29281 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc.h (lang_cleanup_tree): Remove.mmitchel1999-09-091-8/+0
| | | | | | | | | | | | * gcc-simple.c (ggc_free_tree): Don't call lang_cleanup_tree. * ggc-callbacks.c (lang_cleanup_tree): Remove. * c-decl.c (finish_struct): Use ggc_alloc to allocate TYPE_LANG_SPECIFIC when garbage collecting. (lang_cleanup_tree): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29242 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-simple.c (IS_MARKED, IGNORE_MARK): New.rth1999-09-091-21/+63
| | | | | | | | | | | | | | | | (GGC_ANY_MAGIC, GGC_ANY_MAGIC_MARK): New. (struct ggc_any): Replace `mark' with `magic_mark'. (ggc_alloc_string): Use memcpy, not bcopy. (ggc_alloc_any): Set magic_mark. Update bytes_alloced_since_gc. (ggc_free_{rtx,rtvec,tree,string}): Mark inline. (ggc_free_any): New. (ggc_mark_string): Use IGNORE_MARK. Calc back to struct gcc_string. (ggc_mark): Use IGNORE_MARK. Abort if magic doesn't match. (ggc_collect): Re-enable collection avoidance. Use GGC_ANY_MARK. Use IS_MARKED. Use ggc_free_any. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29231 138bc75d-0d04-0410-961f-82ee72b054a4
* * combine.c (SUBST): Break out to a real function do_SUBST.rth1999-09-091-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (SUBST_INT): Likewise. * gcse.c (free_pre_mem): Free `temp_bitmap'. (pre_insert): Free `inserted'. * loop.c (basic_induction_var): Always set `location'. * function.c (expand_function_end): Add initial_trampoline as a root. * rtl.h (init_varasm_once): Declare. * toplev.c (compile_file): Call it. * ggc-simple.c (ggc_mark_string_ptr): New. (ggc_add_string_root): New. (ggc_collect): Disable collection avoidance temporarily. * ggc.h (ggc_add_string_root): Declare. * except.c (create_rethrow_ref): Use ggc_alloc_string. * optabs.c (init_libfuncs): Likewise. * varasm.c (named_section): Use ggc_alloc_string. (make_function_rtl): Likewise. (make_decl_rtl): Likewise. (assemble_static_space): Likewise. (assemble_trampoline_template): Likewise. (output_constant_def): Likewise. (force_const_mem): Likewise. (mark_const_hash_entry): New. (mark_pool_sym_hash_table): New. (mark_varasm_state): Use it. (init_varasm_once): New. * expr.h (init_one_libfunc): Declare. * optabs.c (init_one_libfunc): New. (init_optabs): Use it. * config/gofast.h: Likewise. * config/sparc/sol2.h (INIT_SUBTARGET_OPTABS): Likewise. * config/sparc/sparc.h (INIT_TARGET_OPTABS): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29226 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc.h (ggc_alloc): New function.mmitchel1999-09-091-3/+83
| | | | | | | | | | | | | (ggc_mark): Likewise. * ggc-simple.c (ggc_any): New structure. (ggc_status): Add anys. (n_anys_collected): New variable. (ggc_alloc): Define. (ggc_mark): Likewise. (ggc_collect): Collect the anys. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29222 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-simple.c (ggc_free_rtx): Poison the correct amountrth1999-09-081-1/+2
| | | | | | | for the rtx length. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29215 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-simple.c (init_ggc): Absorb the old init.rth1999-09-081-22/+17
| | | | | | | | | (ggc_push_context): Use xcalloc. (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Likewise. (ggc_collect): Add [rvts] tags to the collection stats. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29206 138bc75d-0d04-0410-961f-82ee72b054a4
* * emit-rtl.c (free_emit_status): Take decl as a parameter.mmitchel1999-09-071-36/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29170 138bc75d-0d04-0410-961f-82ee72b054a4
* Commit parts that were missing in Mark's last commitcrux1999-09-071-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29164 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (ggc-simple.o): Depend on hash.h.mmitchel1999-09-061-1/+48
| | | | | | | | | | | | | | | | | | * ggc.h (ggc_add_tree_hash_table_root): Declare. (ggc_mark_tree_varray): Likewise. (ggc_mark_tree_hash_table): Likewise. * ggc-simple.c: Include hash.h. (ggc_mark_tree_hash_table_ptr): New function. (ggc_mark_tree_hash_table_entry): Likewise. (ggc_mark_tree_hash_table): Likewise. (ggc_add_tree_hash_table_root): Likewise. * varray.h (const_equiv_data): Use struct rtx_def *, rather than * profile.c (output_func_start_profiler): Remove apparently nonsensical call to start_sequence. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29134 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (ggc-simple.o): Depend on varray.h.mmitchel1999-09-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29125 138bc75d-0d04-0410-961f-82ee72b054a4
* * ggc-simple.c (ggc_root, ggc_collect): Wrap prototype with PROTO.ghazi1999-09-051-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29118 138bc75d-0d04-0410-961f-82ee72b054a4
* * Makefile.in (GGC, GGC_LIB): New.mmitchel1999-09-041-0/+714
(HOST_RTL): Include ggc-none.o. (ggc-simple.o): New target. (ggc-none.o): Likewise. * tree.h (tree_common): Add gc_mark. * rtl.h (struct rtx_def): Steal a bit from code to make gc_mark. (struct rtvec_def): Add gc_mark. * emit-rtl.c (global_rtl): Update static initializers to contain enough initializers. * ggc.h, ggc-none.c, ggc-simple.c: New files. * toplev.c (gc_time): New variable. (all_time): New variable. (compile_file): Print gc time. (print_time): Calculate percentage of the whole. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29106 138bc75d-0d04-0410-961f-82ee72b054a4