toplev.c: Make *_time variable long to reduce chance of overflow.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sat, 15 Apr 2000 16:59:10 +0000 (16:59 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 15 Apr 2000 16:59:10 +0000 (12:59 -0400)
* 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

gcc/ChangeLog
gcc/toplev.c
gcc/toplev.h
gcc/tree.c

index 1a5d65744c356e474c77e44e0627349753361fa2..5f2b8111609ae02242e377322b85dba63d787c46 100644 (file)
@@ -1,6 +1,13 @@
 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.
        * libgcc2.c (__fixunstfDI): Renamed from __fixunstfdi.
        (__fixunsxfDI): Renamed from __fixunsxfdi.
index 00721b31248d2d18519e9c6c43b0054200e9a8b6..1a2b4f912d98c5505c0b2a6e0cd9b8844b051e6e 100644 (file)
@@ -1403,36 +1403,36 @@ read_integral_parameter (p, pname, defval)
 
 /* Time accumulators, to count the total time spent in various passes.  */
 
-int parse_time;
-int varconst_time;
-int integration_time;
-int jump_time;
-int cse_time;
-int gcse_time;
-int loop_time;
-int cse2_time;
-int branch_prob_time;
-int flow_time;
-int combine_time;
-int regmove_time;
-int sched_time;
-int local_alloc_time;
-int global_alloc_time;
-int flow2_time;
-int peephole2_time;
-int sched2_time;
-int dbr_sched_time;
-int reorder_blocks_time;
-int rename_registers_time;
-int shorten_branch_time;
-int stack_reg_time;
-int to_ssa_time;
-int from_ssa_time;
-int final_time;
-int symout_time;
-int dump_time;
-int gc_time;
-int all_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;
 \f
 /* Return time used so far, in microseconds.  */
 
@@ -1503,18 +1503,23 @@ get_run_time ()
 #endif /* __BEOS__ */
 }
 
-#define TIMEVAR(VAR, BODY)    \
-do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
+#define TIMEVAR(VAR, BODY)             \
+do {                                   \
+  long otime = get_run_time ();                \
+  BODY;                                        \
+  VAR += get_run_time () - otime;      \
+} while (0)
 
 void
 print_time (str, total)
      const char *str;
-     int total;
+     long total;
 {
   fprintf (stderr,
-          "time in %s: %d.%06d (%d%%)\n",
+          "time in %s: %ld.%06ld (%ld%%)\n",
           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.  */
@@ -1528,6 +1533,7 @@ decl_name (decl, verbosity)
 }
 \f
 /* Mark P for GC.  Also mark main_input_filename and input_filename.  */
+
 static void
 mark_file_stack (p)
      void *p;
index 5779ff994e336c2d07e1d00f88d10c72164ca850..e5a06fff093ba12cbaa75c03dc5d4c26039fd4c5 100644 (file)
@@ -30,7 +30,7 @@ extern int read_integral_parameter    PARAMS ((const char *, const char *,
                                                const int));
 extern int count_error                 PARAMS ((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_end_source_file      PARAMS ((unsigned));
 extern void debug_define               PARAMS ((unsigned, char *));
index 24eca04e5541a644350d2c091020f3c91338a9c3..72d670cf3ac1a6d57659e20d0b0a32a392c2b2b8 100644 (file)
@@ -5170,7 +5170,7 @@ int_fits_type_p (c, type)
 }
 
 /* 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
 get_containing_scope (t)
@@ -5193,6 +5193,7 @@ decl_function_context (decl)
 
   if (TREE_CODE (decl) == SAVE_EXPR)
     context = SAVE_EXPR_CONTEXT (decl);
+
   /* C++ virtual functions use DECL_CONTEXT for the class of the vtable
      where we look up the function at runtime.  Such functions always take
      a first argument of type 'pointer to real context'.
@@ -5200,8 +5201,9 @@ decl_function_context (decl)
      C++ should really be fixed to use DECL_CONTEXT for the real context,
      and use something else for the "virtual context".  */
   else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl))
-    context = TYPE_MAIN_VARIANT
-      (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
+    context
+      = TYPE_MAIN_VARIANT
+       (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
   else
     context = DECL_CONTEXT (decl);