Commit 77a02dba by Richard Kenner Committed by Richard Kenner

toplev.c: Make *_time variable long to reduce chance of overflow.

	* 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.
	* toplev.h (print_time): Arg is long.

	* tree.c: Minor whitespace changes.

From-SVN: r33168
parent b1a88540
Sat Apr 15 10:59:19 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Sat Apr 15 10:59:19 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* configure.in (alpha*-*-*): Aad config/alpha/t-alpha. * 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.
* toplev.h (print_time): Arg is long.
* tree.c: Minor whitespace changes.
* configure.in (alpha*-*-*): Add config/alpha/t-alpha.
* configure: Rebuilt. * configure: Rebuilt.
* libgcc2.c (__fixunstfDI): Renamed from __fixunstfdi. * libgcc2.c (__fixunstfDI): Renamed from __fixunstfdi.
(__fixunsxfDI): Renamed from __fixunsxfdi. (__fixunsxfDI): Renamed from __fixunsxfdi.
......
...@@ -1403,36 +1403,36 @@ read_integral_parameter (p, pname, defval) ...@@ -1403,36 +1403,36 @@ 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. */
int parse_time; long parse_time;
int varconst_time; long varconst_time;
int integration_time; long integration_time;
int jump_time; long jump_time;
int cse_time; long cse_time;
int gcse_time; long gcse_time;
int loop_time; long loop_time;
int cse2_time; long cse2_time;
int branch_prob_time; long branch_prob_time;
int flow_time; long flow_time;
int combine_time; long combine_time;
int regmove_time; long regmove_time;
int sched_time; long sched_time;
int local_alloc_time; long local_alloc_time;
int global_alloc_time; long global_alloc_time;
int flow2_time; long flow2_time;
int peephole2_time; long peephole2_time;
int sched2_time; long sched2_time;
int dbr_sched_time; long dbr_sched_time;
int reorder_blocks_time; long reorder_blocks_time;
int rename_registers_time; long rename_registers_time;
int shorten_branch_time; long shorten_branch_time;
int stack_reg_time; long stack_reg_time;
int to_ssa_time; long to_ssa_time;
int from_ssa_time; long from_ssa_time;
int final_time; long final_time;
int symout_time; long symout_time;
int dump_time; long dump_time;
int gc_time; long gc_time;
int all_time; long all_time;
/* Return time used so far, in microseconds. */ /* Return time used so far, in microseconds. */
...@@ -1503,18 +1503,23 @@ get_run_time () ...@@ -1503,18 +1503,23 @@ get_run_time ()
#endif /* __BEOS__ */ #endif /* __BEOS__ */
} }
#define TIMEVAR(VAR, BODY) \ #define TIMEVAR(VAR, BODY) \
do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0) do { \
long otime = get_run_time (); \
BODY; \
VAR += get_run_time () - otime; \
} while (0)
void void
print_time (str, total) print_time (str, total)
const char *str; const char *str;
int total; long total;
{ {
fprintf (stderr, fprintf (stderr,
"time in %s: %d.%06d (%d%%)\n", "time in %s: %ld.%06ld (%ld%%)\n",
str, total / 1000000, total % 1000000, str, total / 1000000, total % 1000000,
all_time == 0 ? 0 : (100 * total) / all_time); all_time == 0 ? 0
: (long) (((100.0 * (double) total) / (double) all_time) + .5));
} }
/* This is the default decl_printable_name function. */ /* This is the default decl_printable_name function. */
...@@ -1528,6 +1533,7 @@ decl_name (decl, verbosity) ...@@ -1528,6 +1533,7 @@ decl_name (decl, verbosity)
} }
/* Mark P for GC. Also mark main_input_filename and input_filename. */ /* Mark P for GC. Also mark main_input_filename and input_filename. */
static void static void
mark_file_stack (p) mark_file_stack (p)
void *p; void *p;
......
...@@ -30,7 +30,7 @@ extern int read_integral_parameter PARAMS ((const char *, const char *, ...@@ -30,7 +30,7 @@ extern int read_integral_parameter PARAMS ((const char *, const char *,
const int)); const int));
extern int count_error PARAMS ((int)); extern int count_error PARAMS ((int));
extern void strip_off_ending PARAMS ((char *, int)); extern void strip_off_ending PARAMS ((char *, int));
extern void print_time PARAMS ((const char *, int)); extern void print_time PARAMS ((const char *, long));
extern void debug_start_source_file PARAMS ((char *)); extern void debug_start_source_file PARAMS ((char *));
extern void debug_end_source_file PARAMS ((unsigned)); extern void debug_end_source_file PARAMS ((unsigned));
extern void debug_define PARAMS ((unsigned, char *)); extern void debug_define PARAMS ((unsigned, char *));
......
...@@ -5170,7 +5170,7 @@ int_fits_type_p (c, type) ...@@ -5170,7 +5170,7 @@ int_fits_type_p (c, type)
} }
/* Given a DECL or TYPE, return the scope in which it was declared, or /* Given a DECL or TYPE, return the scope in which it was declared, or
NUL_TREE if there is no containing scope. */ NULL_TREE if there is no containing scope. */
tree tree
get_containing_scope (t) get_containing_scope (t)
...@@ -5193,6 +5193,7 @@ decl_function_context (decl) ...@@ -5193,6 +5193,7 @@ decl_function_context (decl)
if (TREE_CODE (decl) == SAVE_EXPR) if (TREE_CODE (decl) == SAVE_EXPR)
context = SAVE_EXPR_CONTEXT (decl); context = SAVE_EXPR_CONTEXT (decl);
/* C++ virtual functions use DECL_CONTEXT for the class of the vtable /* C++ virtual functions use DECL_CONTEXT for the class of the vtable
where we look up the function at runtime. Such functions always take where we look up the function at runtime. Such functions always take
a first argument of type 'pointer to real context'. a first argument of type 'pointer to real context'.
...@@ -5200,8 +5201,9 @@ decl_function_context (decl) ...@@ -5200,8 +5201,9 @@ decl_function_context (decl)
C++ should really be fixed to use DECL_CONTEXT for the real context, C++ should really be fixed to use DECL_CONTEXT for the real context,
and use something else for the "virtual context". */ and use something else for the "virtual context". */
else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl)) else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl))
context = TYPE_MAIN_VARIANT context
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl))))); = TYPE_MAIN_VARIANT
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
else else
context = DECL_CONTEXT (decl); context = DECL_CONTEXT (decl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment