Commit d9b6874b by Zack Weinberg

final.c (shorten_branches): Clear the end of the label_align array only if we made it larger.

	* 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.

From-SVN: r44948
parent 4266d0b2
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> Thu Aug 16 17:39:45 CEST 2001 Jan Hubicka <jh@suse.cz>
* function.c (put_var_into_stack): Temporarily clear DECL_RTL. * 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) ...@@ -60,7 +77,7 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com)
note from its associated jump. note from its associated jump.
2001-08-14 Ulrich Weigand <uweigand@de.ibm.com> 2001-08-14 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/linux64.h (CPP_PREDEFINES): Define __s390__ * config/s390/linux64.h (CPP_PREDEFINES): Define __s390__
also on 64-bit s390x targets. also on 64-bit s390x targets.
...@@ -74,7 +91,7 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com) ...@@ -74,7 +91,7 @@ Tue Aug 14 17:30:59 2001 Jeffrey A Law (law@cygnus.com)
macro with an invocation of macro with an invocation of
arm_compute_initial_elimination_offset. arm_compute_initial_elimination_offset.
* config/arm/arm-protos.h: Prototype * 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> 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) ...@@ -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> Tue Aug 14 14:57:07 CEST 2001 Jan Hubicka <jh@suse.cz>
* genattrtab.c (simplify_test_exp_in_temp): New function. * genattrtab.c (simplify_test_exp_in_temp): New function.
(simplify_test_exp): Avoid explicit use of temporary obstack. (simplify_test_exp): Avoid explicit use of temporary obstack.
(simplify_cond, insert_right_side, evaluate_eq_attr, (simplify_cond, insert_right_side, evaluate_eq_attr,
simplify_and_tree, simplify_or_tree, eliminate_known_true): simplify_and_tree, simplify_or_tree, eliminate_known_true):
Use simplify_test_exp_in_temp. Use simplify_test_exp_in_temp.
(optimize_attrs): Iterate until expression stabilizes. (optimize_attrs): Iterate until expression stabilizes.
2001-08-13 Ulrich Weigand <uweigand@de.ibm.com>: 2001-08-13 Ulrich Weigand <uweigand@de.ibm.com>:
* glimits.h: Remove the __LONG_MAX__ special case for s390x. * glimits.h: Remove the __LONG_MAX__ special case for s390x.
* config/s390/linux64.h: Define __LONG_MAX__ in CPP_PREDEFINES. * config/s390/linux64.h: Define __LONG_MAX__ in CPP_PREDEFINES.
......
...@@ -1314,6 +1314,9 @@ internal_error VPARAMS ((const char *msgid, ...)) ...@@ -1314,6 +1314,9 @@ internal_error VPARAMS ((const char *msgid, ...))
msgid = va_arg (ap, const char *); msgid = va_arg (ap, const char *);
#endif #endif
if (diagnostic_lock)
error_recursion ();
if (errorcount > 0 || sorrycount > 0) if (errorcount > 0 || sorrycount > 0)
{ {
fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n", fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
......
...@@ -1062,12 +1062,20 @@ shorten_branches (first) ...@@ -1062,12 +1062,20 @@ shorten_branches (first)
if (max_labelno != max_label_num ()) if (max_labelno != max_label_num ())
{ {
int old = max_labelno; int old = max_labelno;
int n_labels;
int n_old_labels;
max_labelno = max_label_num (); 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 = (struct label_alignment *) xrealloc
(label_align, (label_align, n_labels * sizeof (struct label_alignment));
(max_labelno - min_labelno + 1) * sizeof (struct label_alignment));
memset (label_align + old + 1 - min_labelno, 0, if (n_old_labels < n_labels)
sizeof (struct label_alignment) * (max_labelno - old)); 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 /* Initialize label_align and set up uid_shuid to be strictly
......
...@@ -74,9 +74,6 @@ extern clock_t clock PARAMS ((void)); ...@@ -74,9 +74,6 @@ extern clock_t clock PARAMS ((void));
# endif # endif
#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 /* Prefer times to getrusage to clock (each gives successively less
information). */ information). */
#ifdef HAVE_TIMES #ifdef HAVE_TIMES
...@@ -97,6 +94,20 @@ extern clock_t clock PARAMS ((void)); ...@@ -97,6 +94,20 @@ extern clock_t clock PARAMS ((void));
#endif #endif
#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 "flags.h"
#include "timevar.h" #include "timevar.h"
...@@ -179,32 +190,19 @@ get_time (now) ...@@ -179,32 +190,19 @@ get_time (now)
{ {
#ifdef USE_TIMES #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; struct tms tms;
if (ticks_to_usec == 0) now->wall = times (&tms) * ticks_to_msec;
ticks_to_usec = TICKS_TO_USEC; now->user = tms.tms_utime * ticks_to_msec;
now->sys = tms.tms_stime * ticks_to_msec;
now->wall = times (&tms) * ticks_to_usec;
now->user = tms.tms_utime * ticks_to_usec;
now->sys = tms.tms_stime * ticks_to_usec;
#endif #endif
#ifdef USE_GETRUSAGE #ifdef USE_GETRUSAGE
struct rusage rusage; struct rusage rusage;
getrusage (RUSAGE_SELF, &rusage); getrusage (RUSAGE_SELF, &rusage);
now->user now->user = rusage.ru_utime.tv_sec * 1000 + rusage.ru_utime.tv_usec / 1000;
= rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec; now->sys = rusage.ru_stime.tv_sec * 1000 + rusage.ru_stime.tv_usec / 1000;
now->sys
= rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec;
#endif #endif
#ifdef USE_CLOCK #ifdef USE_CLOCK
static int clocks_to_usec; now->user = clock () * clocks_to_msec;
if (clocks_to_usec == 0)
clocks_to_usec = CLOCKS_TO_USEC;
now->user = clock () * clocks_to_usec;
#endif #endif
} }
} }
...@@ -238,6 +236,13 @@ init_timevar () ...@@ -238,6 +236,13 @@ init_timevar ()
timevars[identifer__].name = name__; timevars[identifer__].name = name__;
#include "timevar.def" #include "timevar.def"
#undef DEFTIMEVAR #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 /* Push TIMEVAR onto the timing stack. No further elapsed time is
...@@ -439,7 +444,7 @@ timevar_print (fp) ...@@ -439,7 +444,7 @@ timevar_print (fp)
TIMEVAR. */ TIMEVAR. */
start_time = now; start_time = now;
fprintf (fp, _("\nExecution times (seconds)\n")); fputs (_("\nExecution times (seconds)\n"), fp);
for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id) for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
{ {
struct timevar_def *tv = &timevars[(timevar_id_t) id]; struct timevar_def *tv = &timevars[(timevar_id_t) id];
...@@ -453,52 +458,55 @@ timevar_print (fp) ...@@ -453,52 +458,55 @@ timevar_print (fp)
if (!tv->used) if (!tv->used)
continue; 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. */ /* The timing variable name. */
fprintf (fp, " %-22s:", tv->name); fprintf (fp, " %-22s:", tv->name);
#ifdef HAVE_USER_TIME #ifdef HAVE_USER_TIME
/* Print user-mode time for this process. */ /* Print user-mode time for this process. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) usr", fprintf (fp, "%4ld.%02ld (%2.0f%%) usr",
tv->elapsed.user / 1000000, tv->elapsed.user / 1000, (tv->elapsed.user % 1000) / 10,
(tv->elapsed.user % 1000000) / 10000, (total->user == 0) ? 0.0
(total->user == 0) ? 0.0
: (100.0 * tv->elapsed.user / (double) total->user)); : (100.0 * tv->elapsed.user / (double) total->user));
#endif /* HAVE_USER_TIME */ #endif /* HAVE_USER_TIME */
#ifdef HAVE_SYS_TIME #ifdef HAVE_SYS_TIME
/* Print system-mode time for this process. */ /* Print system-mode time for this process. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) sys", fprintf (fp, "%4ld.%02ld (%2.0f%%) sys",
tv->elapsed.sys / 1000000, tv->elapsed.sys / 1000, (tv->elapsed.sys % 1000) / 10,
(tv->elapsed.sys % 1000000) / 10000, (total->sys == 0) ? 0.0
(total->sys == 0) ? 0.0
: (100.0 * tv->elapsed.sys / (double) total->sys)); : (100.0 * tv->elapsed.sys / (double) total->sys));
#endif /* HAVE_SYS_TIME */ #endif /* HAVE_SYS_TIME */
#ifdef HAVE_WALL_TIME #ifdef HAVE_WALL_TIME
/* Print wall clock time elapsed. */ /* Print wall clock time elapsed. */
fprintf (fp, "%4ld.%02ld (%2.0f%%) wall", fprintf (fp, "%4ld.%02ld (%2.0f%%) wall",
tv->elapsed.wall / 1000000, tv->elapsed.wall / 1000, (tv->elapsed.wall % 1000) / 10,
(tv->elapsed.wall % 1000000) / 10000, (total->wall == 0) ? 0.0
(total->wall == 0) ? 0.0
: (100.0 * tv->elapsed.wall / (double) total->wall)); : (100.0 * tv->elapsed.wall / (double) total->wall));
#endif /* HAVE_WALL_TIME */ #endif /* HAVE_WALL_TIME */
fprintf (fp, "\n"); putc ('\n', fp);
} }
/* Print total time. */ /* Print total time. */
fprintf (fp, _(" TOTAL :")); fputs (_(" TOTAL :"), fp);
#ifdef HAVE_USER_TIME #ifdef HAVE_USER_TIME
fprintf (fp, "%4ld.%02ld ", fprintf (fp, "%4ld.%02ld ",
total->user / 1000000, (total->user % 1000000) / 10000); total->user / 1000, (total->user % 1000) / 10);
#endif #endif
#ifdef HAVE_SYS_TIME #ifdef HAVE_SYS_TIME
fprintf (fp, "%4ld.%02ld ", fprintf (fp, "%4ld.%02ld ",
total->sys / 1000000, (total->sys % 1000000) / 10000); total->sys / 1000, (total->sys % 1000) / 10);
#endif #endif
#ifdef HAVE_WALL_TIME #ifdef HAVE_WALL_TIME
fprintf (fp, "%4ld.%02ld\n", fprintf (fp, "%4ld.%02ld\n",
total->wall / 1000000, (total->wall % 1000000) / 10000); total->wall / 1000, (total->wall % 1000) / 10);
#endif #endif
#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) #endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
*/ */
/* This structure stores the various varieties of time that can be /* 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 absolute time or a time difference; in the former case, the time
base is undefined, except that the difference between two times base is undefined, except that the difference between two times
produces a valid time difference. */ produces a valid time difference. */
...@@ -53,14 +53,14 @@ ...@@ -53,14 +53,14 @@
struct timevar_time_def struct timevar_time_def
{ {
/* User time in this process. */ /* User time in this process. */
long user; unsigned long user;
/* System time (if applicable for this host platform) in this /* System time (if applicable for this host platform) in this
process. */ process. */
long sys; unsigned long sys;
/* Wall clock time. */ /* Wall clock time. */
long wall; unsigned long wall;
}; };
/* An enumeration of timing variable indentifiers. Constructed from /* An enumeration of timing variable indentifiers. Constructed from
......
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