This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix -ftime-report for C++ lookup
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Mon, 20 Aug 2012 10:23:28 -0400
- Subject: Fix -ftime-report for C++ lookup
Found this while running -ftime-report on a largish C++ source file.
We need to start TV_NAME_LOOKUP conditionally inside poplevel()
because it may be called from another lookup routine that already has
TV_NAME_LOOKUP going.
Tested on x86_64. Committed to trunk.
2012-08-20 Diego Novillo <dnovillo@google.com>
* decl.c (poplevel): Start TV_NAME_LOOKUP conditionally.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5908996..0dad597 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -552,7 +552,7 @@ poplevel (int keep, int reverse, int functionbody)
unsigned ix;
cp_label_binding *label_bind;
- timevar_start (TV_NAME_LOOKUP);
+ bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
restart:
block = NULL_TREE;
@@ -818,7 +818,7 @@ poplevel (int keep, int reverse, int functionbody)
if (kind == sk_cleanup)
goto restart;
- timevar_stop (TV_NAME_LOOKUP);
+ timevar_cond_stop (TV_NAME_LOOKUP, subtime);
return block;
}