From b9bfacf01ce274e236db460890bcce882835cce1 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 15 Apr 2000 19:54:26 +0000 Subject: Makefile.in (ggc-page.o): Now includes toplev.h. * Makefile.in (ggc-page.o): Now includes toplev.h. * ggc-page.c (toplev.h): Now included. (gc_time): Remove declaration. (ggc_collect): TIME now long. * toplev.c (parse_time, varasm_time, gc_time): Still global; all others static. * toplev.h (gc_time, parse_time, gc_time): New declarations. * cp/decl2.c (parse_time, varconst_time): Delete declarations. (finish_file): Delete LINENO declaration. START_TIME and THIS_TIME now long. From-SVN: r33169 --- gcc/ChangeLog | 8 ++++++++ gcc/Makefile.in | 2 +- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl2.c | 6 ++---- gcc/ggc-page.c | 34 +++++++++++++++----------------- gcc/toplev.c | 60 +++++++++++++++++++++++++++++--------------------------- gcc/toplev.h | 4 ++++ 7 files changed, 68 insertions(+), 52 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5f2b811..b59b15e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ Sat Apr 15 10:59:19 2000 Richard Kenner + * Makefile.in (ggc-page.o): Now includes toplev.h. + * ggc-page.c (toplev.h): Now included. + (gc_time): Remove declaration. + (ggc_collect): TIME now long. + * toplev.c (parse_time, varasm_time, gc_time): Still global; all + others static. + * toplev.h (gc_time, parse_time, gc_time): New declarations. + * toplev.c: Make *_time variable long to reduce chance of overflow. (TIMEVAR): Likewise for `otime'. (print_time): Arg is now long; compute percentage in FP and round. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 74e5485..ad582c4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1475,7 +1475,7 @@ ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \ ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ $(GGC_H) varray.h -ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \ +ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h toplev.h \ $(GGC_H) varray.h ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) $(GGC_H) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 19b5e4e..2c49725 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +Sat Apr 15 16:00:01 2000 Richard Kenner + + * decl2.c (parse_time, varconst_time): Delete declarations. + (finish_file): Delete LINENO declaration. + START_TIME and THIS_TIME now long. + 2000-04-13 Nathan Sidwell * class.c (build_base_field): Reformat comment. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 83279a1..18d41aa9 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2760,8 +2760,6 @@ build_cleanup (decl) return temp; } -extern int parse_time, varconst_time; - static tree get_sentry (base) tree base; @@ -2771,6 +2769,7 @@ get_sentry (base) __snfoo. Since base is already an assembler name, sname should be globally unique */ tree sentry = IDENTIFIER_GLOBAL_VALUE (sname); + if (! sentry) { sentry = build_decl (VAR_DECL, sname, integer_type_node); @@ -3413,8 +3412,7 @@ generate_ctor_and_dtor_functions_for_priority (n, data) void finish_file () { - extern int lineno; - int start_time, this_time; + long start_time, this_time; tree vars; int reconsider; size_t i; diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index a7490f3..7fc8b2c 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -1,28 +1,29 @@ /* "Bag-of-pages" garbage collector for the GNU compiler. Copyright (C) 1999, 2000 Free Software Foundation, Inc. - This file is part of GNU CC. +This file is part of GNU CC. - GNU CC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. - GNU CC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with GNU CC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include "tree.h" #include "rtl.h" #include "tm_p.h" +#include "toplev.h" #include "varray.h" #include "flags.h" #include "ggc.h" @@ -97,9 +98,6 @@ #define HOST_BITS_PER_PTR HOST_BITS_PER_LONG #endif -/* Timing information for collect execution goes into here. */ -extern int gc_time; - /* The "" allocated string. */ char *empty_string; @@ -1103,7 +1101,7 @@ poison_pages () void ggc_collect () { - int time; + long time; /* Avoid frequent unnecessary work by skipping collection if the total allocations haven't expanded much since the last @@ -1115,7 +1113,7 @@ ggc_collect () time = get_run_time (); if (!quiet_flag) - fprintf (stderr, " {GC %luk -> ", (unsigned long)G.allocated / 1024); + fprintf (stderr, " {GC %luk -> ", (unsigned long) G.allocated / 1024); /* Zero the total allocated bytes. We'll reaccumulate this while marking. */ diff --git a/gcc/toplev.c b/gcc/toplev.c index 1a2b4f9..e90f994e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1401,38 +1401,40 @@ read_integral_parameter (p, pname, defval) } -/* Time accumulators, to count the total time spent in various passes. */ +/* Time accumulators, to count the total time spent in various passes. + The first three are used in other files; the latter two only here. */ +long gc_time; long parse_time; long varconst_time; -long integration_time; -long jump_time; -long cse_time; -long gcse_time; -long loop_time; -long cse2_time; -long branch_prob_time; -long flow_time; -long combine_time; -long regmove_time; -long sched_time; -long local_alloc_time; -long global_alloc_time; -long flow2_time; -long peephole2_time; -long sched2_time; -long dbr_sched_time; -long reorder_blocks_time; -long rename_registers_time; -long shorten_branch_time; -long stack_reg_time; -long to_ssa_time; -long from_ssa_time; -long final_time; -long symout_time; -long dump_time; -long gc_time; -long all_time; + +static long integration_time; +static long jump_time; +static long cse_time; +static long gcse_time; +static long loop_time; +static long cse2_time; +static long branch_prob_time; +static long flow_time; +static long combine_time; +static long regmove_time; +static long sched_time; +static long local_alloc_time; +static long global_alloc_time; +static long flow2_time; +static long peephole2_time; +static long sched2_time; +static long dbr_sched_time; +static long reorder_blocks_time; +static long rename_registers_time; +static long shorten_branch_time; +static long stack_reg_time; +static long to_ssa_time; +static long from_ssa_time; +static long final_time; +static long symout_time; +static long dump_time; +static long all_time; /* Return time used so far, in microseconds. */ diff --git a/gcc/toplev.h b/gcc/toplev.h index e5a06ff..470b209 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -26,6 +26,10 @@ union tree_node; struct rtx_def; #endif +extern long gc_time; +extern long parse_time; +extern long varconst_time; + extern int read_integral_parameter PARAMS ((const char *, const char *, const int)); extern int count_error PARAMS ((int)); -- cgit v1.1