This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA jit] clear timevar_enable in timevar_print
- From: Tom Tromey <tromey at redhat dot com>
- To: jit at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 3 Apr 2014 14:37:06 -0600
- Subject: [RFA jit] clear timevar_enable in timevar_print
- Authentication-results: sourceware.org; auth=none
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 <tromey@redhat.com>
+ * timevar.c (timevar_print): Clear timevar_enable.
+
+2014-03-24 Tom Tromey <tromey@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