The timevar module doesn't properly re-initialize timevar_print
between invocations of the compiler.  In particular, if the compiler
is put into verbose mode, and subsequently put back into quiet mode,
then timevar_enable is never set to false -- leading to unwanted
timevar display.

This patch fixes the problem by clearing timevar_enable in
timevar_print.
---
 gcc/ChangeLog.jit | 4 ++++
 gcc/timevar.c     | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/gcc/ChangeLog.jit b/gcc/ChangeLog.jit
index 5145cf9..6ef9794 100644
--- a/gcc/ChangeLog.jit
+++ b/gcc/ChangeLog.jit
@@ -1,5 +1,9 @@
 2014-03-24  Tom Tromey  <tro...@redhat.com>
 
+       * timevar.c (timevar_print): Clear timevar_enable.
+
+2014-03-24  Tom Tromey  <tro...@redhat.com>
+
        * toplev.c (general_init): Initialize input_location.
        * input.c (input_location): Initialize to UNKNOWN_LOCATION.
 
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 2ceee51..5e4c4c49 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -491,6 +491,8 @@ timevar_print (FILE *fp)
 
   if (!timevar_enable)
     return;
+  // Clean up for a possible next run.
+  timevar_enable = false;
 
   /* Update timing information in case we're calling this from GDB.  */
 
-- 
1.9.0

Reply via email to