From patchwork Thu Aug 18 17:15:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 110538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 11CCCB6FA5 for ; Fri, 19 Aug 2011 03:15:29 +1000 (EST) Received: (qmail 19385 invoked by alias); 18 Aug 2011 17:15:22 -0000 Received: (qmail 19377 invoked by uid 22791); 18 Aug 2011 17:15:20 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Aug 2011 17:15:06 +0000 Received: from hpaq14.eem.corp.google.com (hpaq14.eem.corp.google.com [172.25.149.14]) by smtp-out.google.com with ESMTP id p7IHF4Fp021510; Thu, 18 Aug 2011 10:15:04 -0700 Received: from tobiano.tor.corp.google.com (tobiano.tor.corp.google.com [172.29.41.6]) by hpaq14.eem.corp.google.com with ESMTP id p7IHF1rZ030931; Thu, 18 Aug 2011 10:15:01 -0700 Received: by tobiano.tor.corp.google.com (Postfix, from userid 54752) id F1130AE1DF; Thu, 18 Aug 2011 13:15:00 -0400 (EDT) To: reply@codereview.appspotmail.com, jason@redhat.com, gcc-patches@gcc.gnu.org Subject: [4.6/4.7] Fix some parser timers (issue4894054) Message-Id: <20110818171500.F1130AE1DF@tobiano.tor.corp.google.com> Date: Thu, 18 Aug 2011 13:15:00 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. --- This patch is available for review at http://codereview.appspot.com/4894054 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; }