From 834fc3247914aeb9abda6b0cff411666f220fa72 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 5 Nov 1998 14:31:36 +0000 Subject: * ggc-simple.c (ggc_collect): Lose the `ignore_after' argument. Disable rate-limiting check if ENABLE_CHECKING. * ggc.h (ggc_collect): Update prototype. * toplev.c (rest_of_compilation): Call ggc_collect after every pass. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/egcs_gc_branch@23541 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.GC | 7 +++++++ gcc/ggc-simple.c | 15 ++++----------- gcc/ggc.h | 2 +- gcc/toplev.c | 37 +++++++++++++++++++++++++++++++++++-- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog.GC b/gcc/ChangeLog.GC index a020468888d..5433b6e1184 100644 --- a/gcc/ChangeLog.GC +++ b/gcc/ChangeLog.GC @@ -1,3 +1,10 @@ +Thu Nov 5 14:28:43 1998 Richard Henderson + + * ggc-simple.c (ggc_collect): Lose the `ignore_after' argument. + Disable rate-limiting check if ENABLE_CHECKING. + * ggc.h (ggc_collect): Update prototype. + * toplev.c (rest_of_compilation): Call ggc_collect after every pass. + Wed Nov 4 13:34:13 1998 Ken Raeburn * expr.c (emit_block_move): Add "memcpy" node to the tree root list. diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c index 3dd8670eb4e..2d5e2c06327 100644 --- a/gcc/ggc-simple.c +++ b/gcc/ggc-simple.c @@ -486,8 +486,7 @@ ggc_mark_string (s) /* The top level mark-and-sweep routine. */ void -ggc_collect (ignore_after) - int ignore_after; +ggc_collect () { struct ggc_rtx *r, **rp; struct ggc_rtvec *v, **vp; @@ -496,9 +495,11 @@ ggc_collect (ignore_after) struct ggc_root *x; int time, n_rtxs, n_trees, n_vecs, n_strings; +#ifndef ENABLE_CHECKING /* See if it's even worth our while. */ - if (!ignore_after && bytes_alloced_since_gc < 64*1024) + if (bytes_alloced_since_gc < 64*1024) return; +#endif if (!quiet_flag) fputs (" {GC ", stderr); @@ -596,14 +597,6 @@ ggc_collect (ignore_after) *sp = NULL; n_strings_collected += n_strings; - if (ignore_after) - { - rtxs = NULL; - vecs = NULL; - trees = NULL; - strings = NULL; - } - gc_time += time = get_run_time () - time; if (!quiet_flag) diff --git a/gcc/ggc.h b/gcc/ggc.h index 43bff9c2c61..dd237be3a45 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -37,7 +37,7 @@ char *ggc_alloc_string PROTO ((const char *contents, int length)); /* Invoke the collector. This is really just a hint, but in the case of the simple collector, the only time it will happen. */ -void ggc_collect PROTO ((int ignore_after)); +void ggc_collect PROTO ((void)); /* Manipulate global roots that are needed between calls to gc. */ void ggc_add_root PROTO ((void *base, int nelt, int size, diff --git a/gcc/toplev.c b/gcc/toplev.c index c96dfc32a4d..10d2b9d6d5e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3417,6 +3417,8 @@ rest_of_compilation (decl) if (jump_opt_dump) dump_rtl (".jump", decl, print_rtl, insns); + ggc_collect (); + /* Perform common subexpression elimination. Nonzero value from `cse_main' means that jumps were simplified and some code may now be unreachable, so do @@ -3446,6 +3448,8 @@ rest_of_compilation (decl) if (cse_dump) close_dump_file (print_rtl, insns); + + ggc_collect (); } purge_addressof (insns); @@ -3454,6 +3458,8 @@ rest_of_compilation (decl) if (addressof_dump) dump_rtl (".addressof", decl, print_rtl, insns); + ggc_collect (); + /* Perform global cse. */ if (optimize > 0 && flag_gcse) @@ -3465,6 +3471,8 @@ rest_of_compilation (decl) if (gcse_dump) close_dump_file (print_rtl, insns); + + ggc_collect (); } /* Move constant computations out of loops. */ @@ -3500,6 +3508,8 @@ rest_of_compilation (decl) if (loop_dump) close_dump_file (print_rtl, insns); + + ggc_collect (); } if (optimize > 0) @@ -3540,6 +3550,8 @@ rest_of_compilation (decl) if (cse2_dump) close_dump_file (print_rtl, insns); + + ggc_collect (); } if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities) @@ -3555,6 +3567,8 @@ rest_of_compilation (decl) if (branch_prob_dump) close_dump_file (print_rtl, insns); + + ggc_collect (); } /* We are no longer anticipating cse in this function, at least. */ @@ -3609,6 +3623,8 @@ rest_of_compilation (decl) if (flow_dump) close_dump_file (print_rtl_with_bb, insns); + ggc_collect (); + /* If -opt, try combining insns through substitution. */ if (optimize > 0) @@ -3619,6 +3635,8 @@ rest_of_compilation (decl) if (combine_dump) dump_rtl (".combine", decl, print_rtl_with_bb, insns); + + ggc_collect (); } /* Register allocation pre-pass, to reduce number of moves @@ -3633,6 +3651,8 @@ rest_of_compilation (decl) if (regmove_dump) close_dump_file (print_rtl_with_bb, insns); + + ggc_collect (); } /* Print function header into sched dump now @@ -3652,6 +3672,8 @@ rest_of_compilation (decl) if (sched_dump) close_dump_file (print_rtl_with_bb, insns); + + ggc_collect (); } /* Unless we did stupid register allocation, @@ -3677,6 +3699,8 @@ rest_of_compilation (decl) close_dump_file (print_rtl_with_bb, insns); } + ggc_collect (); + if (global_reg_dump) open_dump_file (".greg", decl_printable_name (decl, 2)); @@ -3700,6 +3724,7 @@ rest_of_compilation (decl) if (failure) goto exit_rest_of_compilation; + ggc_collect (); reload_completed = 1; /* Do a very simple CSE pass over just the hard registers. */ @@ -3732,6 +3757,8 @@ rest_of_compilation (decl) if (sched2_dump) close_dump_file (print_rtl_with_bb, insns); + + ggc_collect (); } #ifdef LEAF_REGISTERS @@ -3755,6 +3782,8 @@ rest_of_compilation (decl) if (jump2_opt_dump) dump_rtl (".jump2", decl, print_rtl_with_bb, insns); + + ggc_collect (); } /* If a machine dependent reorganization is needed, call it. */ @@ -3763,6 +3792,7 @@ rest_of_compilation (decl) if (mach_dep_reorg_dump) dump_rtl (".mach", decl, print_rtl_with_bb, insns); + ggc_collect (); #endif /* If a scheduling pass for delayed branches is to be done, @@ -3775,6 +3805,8 @@ rest_of_compilation (decl) if (dbr_sched_dump) dump_rtl (".dbr", decl, print_rtl_with_bb, insns); + + ggc_collect (); } #endif @@ -3792,6 +3824,7 @@ rest_of_compilation (decl) if (stack_reg_dump) dump_rtl (".stack", decl, print_rtl_with_bb, insns); + ggc_collect (); #endif /* Now turn the rtl into assembler code. */ @@ -3824,6 +3857,7 @@ rest_of_compilation (decl) /* Release all memory held by regsets now */ regset_release_memory (); }); + ggc_collect (); /* Write DBX symbols if requested */ @@ -3909,13 +3943,12 @@ rest_of_compilation (decl) current_function = 0; cur_f_s = 0; - ggc_collect (0); + ggc_collect (); /* The parsing time is all the time spent in yyparse *except* what is spent in this function. */ parse_time -= get_run_time () - start_time; - } static void -- cgit v1.2.3