public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [4.6/4.7] Fix some parser timers (issue4894054)
@ 2011-08-18 20:19 Diego Novillo
  2011-08-18 21:43 ` Jason Merrill
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2011-08-18 20:19 UTC (permalink / raw)
  To: reply, jason, gcc-patches


Found while building our internal code base with -ftime-report.  This
patch is against google/gcc-4_6, but the bug also exists in 4.7 and
gcc-4_6-branch.

OK for gcc-4_6-branch and trunk?

Tested on x86_64.  Applied to google/gcc-4_6.


Diego.

	* name-lookup.c (lookup_arg_dependent): Use conditional
	timevars.
	* decl.c (xref_tag): Likewise.
	* call.c (build_op_call): Likewise.

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 177856)
+++ cp/decl.c	(working copy)
@@ -11354,9 +11354,10 @@ xref_tag (enum tag_types tag_code, tree 
           tag_scope scope, bool template_header_p)
 {
   tree ret;
-  timevar_start (TV_NAME_LOOKUP);
+  bool subtime;
+  subtime = timevar_cond_start (TV_NAME_LOOKUP);
   ret = xref_tag_1 (tag_code, name, scope, template_header_p);
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, subtime);
   return ret;
 }
 
Index: cp/call.c
===================================================================
--- cp/call.c	(revision 177856)
+++ cp/call.c	(working copy)
@@ -3965,9 +3965,10 @@ tree
 build_op_call (tree obj, VEC(tree,gc) **args, tsubst_flags_t complain)
 {
   tree ret;
-  timevar_start (TV_OVERLOAD);
+  bool subtime;
+  subtime = timevar_cond_start (TV_OVERLOAD);
   ret = build_op_call_1 (obj, args, complain);
-  timevar_stop (TV_OVERLOAD);
+  timevar_cond_stop (TV_OVERLOAD, subtime);
   return ret;
 }
 
Index: cp/name-lookup.c
===================================================================
--- cp/name-lookup.c	(revision 177856)
+++ cp/name-lookup.c	(working copy)
@@ -5441,9 +5441,10 @@ lookup_arg_dependent (tree name, tree fn
                       bool include_std)
 {
   tree ret;
-  timevar_start (TV_NAME_LOOKUP);
+  bool subtime;
+  subtime = timevar_cond_start (TV_NAME_LOOKUP);
   ret = lookup_arg_dependent_1 (name, fns, args, include_std);
-  timevar_stop (TV_NAME_LOOKUP);
+  timevar_cond_stop (TV_NAME_LOOKUP, subtime);
   return ret;
 }
 

--
This patch is available for review at http://codereview.appspot.com/4894054

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [4.6/4.7] Fix some parser timers (issue4894054)
  2011-08-18 20:19 [4.6/4.7] Fix some parser timers (issue4894054) Diego Novillo
@ 2011-08-18 21:43 ` Jason Merrill
  2011-08-18 21:48   ` Jason Merrill
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Merrill @ 2011-08-18 21:43 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, gcc-patches

OK.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [4.6/4.7] Fix some parser timers (issue4894054)
  2011-08-18 21:43 ` Jason Merrill
@ 2011-08-18 21:48   ` Jason Merrill
  2011-08-18 21:51     ` Diego Novillo
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Merrill @ 2011-08-18 21:48 UTC (permalink / raw)
  To: Diego Novillo; +Cc: reply, gcc-patches

On 08/18/2011 04:18 PM, Jason Merrill wrote:
> OK.

For trunk.  The 4.6 branch looks very different.

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [4.6/4.7] Fix some parser timers (issue4894054)
  2011-08-18 21:48   ` Jason Merrill
@ 2011-08-18 21:51     ` Diego Novillo
  0 siblings, 0 replies; 4+ messages in thread
From: Diego Novillo @ 2011-08-18 21:51 UTC (permalink / raw)
  To: Jason Merrill; +Cc: reply, gcc-patches

On 11-08-18 16:18 , Jason Merrill wrote:
> On 08/18/2011 04:18 PM, Jason Merrill wrote:
>> OK.
>
> For trunk. The 4.6 branch looks very different.

Yes, I later realized that we had originally backported this timer patch 
from trunk to google's 4.6 branch.


Thanks.  Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-18 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18 20:19 [4.6/4.7] Fix some parser timers (issue4894054) Diego Novillo
2011-08-18 21:43 ` Jason Merrill
2011-08-18 21:48   ` Jason Merrill
2011-08-18 21:51     ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).