summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-17 01:27:49 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-17 01:27:49 +0000
commit8ebf91ffefc10880feb8c8e5cddeef7a870696f5 (patch)
treed06379f9caf82cb62fa1d7889ebb1309f38e52b8
parent37d9d338b607e66ee1f8b8da8157fc37abbaf55a (diff)
downloadgcc-8ebf91ffefc10880feb8c8e5cddeef7a870696f5.tar.gz
* final.c (shorten_branches): Clear the end of the label_align
array only if we made it larger. Break up messy expressions for clarity. * diagnostic.c (internal_error): Check for error recursion before doing ICE suppression. * timevar.c: Timing variables now count in milliseconds. (init_timevar): Set up ticks_to_msec and clocks_to_msec here. (get_time): Not here. (timevar_print): Don't print any timer whose user, cpu, and wall times are all zero as displayed. * timevar.h: Update comment aboout units. Make timevar counters unsigned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44948 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog35
-rw-r--r--gcc/diagnostic.c3
-rw-r--r--gcc/final.c16
-rw-r--r--gcc/timevar.c82
-rw-r--r--gcc/timevar.h8
5 files changed, 90 insertions, 54 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6800290ebfe..58f6533fe19 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,20 @@
+2001-08-16 Zack Weinberg <zackw@panix.com>
+
+ * final.c (shorten_branches): Clear the end of the label_align
+ array only if we made it larger. Break up messy expressions
+ for clarity.
+
+ * diagnostic.c (internal_error): Check for error recursion
+ before doing ICE suppression.
+
+ * timevar.c: Timing variables now count in milliseconds.
+ (init_timevar): Set up ticks_to_msec and clocks_to_msec here.
+ (get_time): Not here.
+ (timevar_print): Don't print any timer whose user, cpu, and
+ wall times are all zero as displayed.
+ * timevar.h: Update comment aboout units. Make timevar
+ counters unsigned.
+
Thu Aug 16 17:39:45 CEST 2001 Jan Hubicka <jh@suse.cz>
* function.c (put_var_into_stack): Temporarily clear DECL_RTL.
@@ -60,7 +77,7 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com)
note from its associated jump.
2001-08-14 Ulrich Weigand <uweigand@de.ibm.com>
-
+
* config/s390/linux64.h (CPP_PREDEFINES): Define __s390__
also on 64-bit s390x targets.
@@ -74,7 +91,7 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com)
macro with an invocation of
arm_compute_initial_elimination_offset.
* config/arm/arm-protos.h: Prototype
- arm_compute_initial_elimination_offset.
+ arm_compute_initial_elimination_offset.
2001-08-14 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
@@ -112,15 +129,15 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com)
Tue Aug 14 14:57:07 CEST 2001 Jan Hubicka <jh@suse.cz>
- * genattrtab.c (simplify_test_exp_in_temp): New function.
- (simplify_test_exp): Avoid explicit use of temporary obstack.
- (simplify_cond, insert_right_side, evaluate_eq_attr,
- simplify_and_tree, simplify_or_tree, eliminate_known_true):
- Use simplify_test_exp_in_temp.
- (optimize_attrs): Iterate until expression stabilizes.
+ * genattrtab.c (simplify_test_exp_in_temp): New function.
+ (simplify_test_exp): Avoid explicit use of temporary obstack.
+ (simplify_cond, insert_right_side, evaluate_eq_attr,
+ simplify_and_tree, simplify_or_tree, eliminate_known_true):
+ Use simplify_test_exp_in_temp.
+ (optimize_attrs): Iterate until expression stabilizes.
2001-08-13 Ulrich Weigand <uweigand@de.ibm.com>:
-
+
* glimits.h: Remove the __LONG_MAX__ special case for s390x.
* config/s390/linux64.h: Define __LONG_MAX__ in CPP_PREDEFINES.
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index a23c83658ba..4e5d3a814a6 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1314,6 +1314,9 @@ internal_error VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
+ if (diagnostic_lock)
+ error_recursion ();
+
if (errorcount > 0 || sorrycount > 0)
{
fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
diff --git a/gcc/final.c b/gcc/final.c
index ad922915c85..821a814fa45 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1062,12 +1062,20 @@ shorten_branches (first)
if (max_labelno != max_label_num ())
{
int old = max_labelno;
+ int n_labels;
+ int n_old_labels;
+
max_labelno = max_label_num ();
+
+ n_labels = max_labelno - min_labelno + 1;
+ n_old_labels = old - min_labelno + 1;
+
label_align = (struct label_alignment *) xrealloc
- (label_align,
- (max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
- memset (label_align + old + 1 - min_labelno, 0,
- sizeof (struct label_alignment) * (max_labelno - old));
+ (label_align, n_labels * sizeof (struct label_alignment));
+
+ if (n_old_labels < n_labels)
+ memset (label_align + n_old_labels, 0,
+ (n_labels - n_old_labels) * sizeof (struct label_alignment));
}
/* Initialize label_align and set up uid_shuid to be strictly
diff --git a/gcc/timevar.c b/gcc/timevar.c
index def57b55cd7..b0e013d39fe 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -74,9 +74,6 @@ extern clock_t clock PARAMS ((void));
# endif
#endif
-#define TICKS_TO_USEC (1000000 / TICKS_PER_SECOND)
-#define CLOCKS_TO_USEC (1000000 / CLOCKS_PER_SEC)
-
/* Prefer times to getrusage to clock (each gives successively less
information). */
#ifdef HAVE_TIMES
@@ -97,6 +94,20 @@ extern clock_t clock PARAMS ((void));
#endif
#endif
+/* libc is very likely to have snuck a call to sysconf() into one of
+ the underlying constants, and that can be very slow, so we have to
+ precompute them. Whose wonderful idea was it to make all those
+ _constants_ variable at run time, anyway? */
+#ifdef USE_TIMES
+static int ticks_to_msec;
+#define TICKS_TO_MSEC (1000 / TICKS_PER_SECOND)
+#endif
+
+#ifdef USE_CLOCK
+static int clocks_to_msec;
+#define CLOCKS_TO_MSEC (1000 / CLOCKS_PER_SEC)
+#endif
+
#include "flags.h"
#include "timevar.h"
@@ -179,32 +190,19 @@ get_time (now)
{
#ifdef USE_TIMES
- /* libc is very likely to have snuck a call to sysconf() into one
- of the underlying constants, and that can make system calls, so
- we have to precompute the value. Whose wonderful idea was it
- to make all those _constants_ variable at run time, anyway? */
- static int ticks_to_usec;
struct tms tms;
- if (ticks_to_usec == 0)
- ticks_to_usec = TICKS_TO_USEC;
-
- now->wall = times (&tms) * ticks_to_usec;
- now->user = tms.tms_utime * ticks_to_usec;
- now->sys = tms.tms_stime * ticks_to_usec;
+ now->wall = times (&tms) * ticks_to_msec;
+ now->user = tms.tms_utime * ticks_to_msec;
+ now->sys = tms.tms_stime * ticks_to_msec;
#endif
#ifdef USE_GETRUSAGE
struct rusage rusage;
getrusage (RUSAGE_SELF, &rusage);
- now->user
- = rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec;
- now->sys
- = rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec;
+ now->user = rusage.ru_utime.tv_sec * 1000 + rusage.ru_utime.tv_usec / 1000;
+ now->sys = rusage.ru_stime.tv_sec * 1000 + rusage.ru_stime.tv_usec / 1000;
#endif
#ifdef USE_CLOCK
- static int clocks_to_usec;
- if (clocks_to_usec == 0)
- clocks_to_usec = CLOCKS_TO_USEC;
- now->user = clock () * clocks_to_usec;
+ now->user = clock () * clocks_to_msec;
#endif
}
}
@@ -238,6 +236,13 @@ init_timevar ()
timevars[identifer__].name = name__;
#include "timevar.def"
#undef DEFTIMEVAR
+
+#ifdef USE_TIMES
+ ticks_to_msec = TICKS_TO_MSEC;
+#endif
+#ifdef USE_CLOCK
+ clocks_to_msec = CLOCKS_TO_MSEC;
+#endif
}
/* Push TIMEVAR onto the timing stack. No further elapsed time is
@@ -439,7 +444,7 @@ timevar_print (fp)
TIMEVAR. */
start_time = now;
- fprintf (fp, _("\nExecution times (seconds)\n"));
+ fputs (_("\nExecution times (seconds)\n"), fp);
for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
{
struct timevar_def *tv = &timevars[(timevar_id_t) id];
@@ -453,52 +458,55 @@ timevar_print (fp)
if (!tv->used)
continue;
+ /* Don't print timing variables if we're going to get a row of
+ zeroes. */
+ if (tv->elapsed.user < 10 && tv->elapsed.sys < 10
+ && tv->elapsed.wall < 10)
+ continue;
+
/* The timing variable name. */
fprintf (fp, " %-22s:", tv->name);
#ifdef HAVE_USER_TIME
/* Print user-mode time for this process. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) usr",
- tv->elapsed.user / 1000000,
- (tv->elapsed.user % 1000000) / 10000,
- (total->user == 0) ? 0.0
+ tv->elapsed.user / 1000, (tv->elapsed.user % 1000) / 10,
+ (total->user == 0) ? 0.0
: (100.0 * tv->elapsed.user / (double) total->user));
#endif /* HAVE_USER_TIME */
#ifdef HAVE_SYS_TIME
/* Print system-mode time for this process. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) sys",
- tv->elapsed.sys / 1000000,
- (tv->elapsed.sys % 1000000) / 10000,
- (total->sys == 0) ? 0.0
+ tv->elapsed.sys / 1000, (tv->elapsed.sys % 1000) / 10,
+ (total->sys == 0) ? 0.0
: (100.0 * tv->elapsed.sys / (double) total->sys));
#endif /* HAVE_SYS_TIME */
#ifdef HAVE_WALL_TIME
/* Print wall clock time elapsed. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) wall",
- tv->elapsed.wall / 1000000,
- (tv->elapsed.wall % 1000000) / 10000,
- (total->wall == 0) ? 0.0
+ tv->elapsed.wall / 1000, (tv->elapsed.wall % 1000) / 10,
+ (total->wall == 0) ? 0.0
: (100.0 * tv->elapsed.wall / (double) total->wall));
#endif /* HAVE_WALL_TIME */
- fprintf (fp, "\n");
+ putc ('\n', fp);
}
/* Print total time. */
- fprintf (fp, _(" TOTAL :"));
+ fputs (_(" TOTAL :"), fp);
#ifdef HAVE_USER_TIME
fprintf (fp, "%4ld.%02ld ",
- total->user / 1000000, (total->user % 1000000) / 10000);
+ total->user / 1000, (total->user % 1000) / 10);
#endif
#ifdef HAVE_SYS_TIME
fprintf (fp, "%4ld.%02ld ",
- total->sys / 1000000, (total->sys % 1000000) / 10000);
+ total->sys / 1000, (total->sys % 1000) / 10);
#endif
#ifdef HAVE_WALL_TIME
fprintf (fp, "%4ld.%02ld\n",
- total->wall / 1000000, (total->wall % 1000000) / 10000);
+ total->wall / 1000, (total->wall % 1000) / 10);
#endif
#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
diff --git a/gcc/timevar.h b/gcc/timevar.h
index 187b60e3cb8..5da847dff38 100644
--- a/gcc/timevar.h
+++ b/gcc/timevar.h
@@ -45,7 +45,7 @@
*/
/* This structure stores the various varieties of time that can be
- measured. Times are stored in microseconds. The time may be an
+ measured. Times are stored in milliseconds. The time may be an
absolute time or a time difference; in the former case, the time
base is undefined, except that the difference between two times
produces a valid time difference. */
@@ -53,14 +53,14 @@
struct timevar_time_def
{
/* User time in this process. */
- long user;
+ unsigned long user;
/* System time (if applicable for this host platform) in this
process. */
- long sys;
+ unsigned long sys;
/* Wall clock time. */
- long wall;
+ unsigned long wall;
};
/* An enumeration of timing variable indentifiers. Constructed from