From patchwork Mon Aug 20 14:23:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 178828 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 5316A2C00C2 for ; Tue, 21 Aug 2012 00:23:53 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1346077433; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=3nhVRB2Xax2fHRQIz0Jk uPmnNzs=; b=rxsLgFM+uSceHaWdiPcpUot2n35YMTHpcXriGUPaaAKEt/H3X/yg 7QemJDGIeyXwmY2ExRKkAp3q3Xj/8Sgzgv6Z5LuAdqptRbgoL7jv/SbhXHvQT6c9 y8GXQ0lzGZbWBrJvu3clcsLd3P4CBmxsavA3GQX92MQotdIq9qVBbmk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Content-Transfer-Encoding:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=pcoWfuul+GRJj85ON1cXZeBPYz+B+2h+G0e+yfh0IIdS/trJhIHHXDJRua7+xa DzLzCSH3B7VljuLQ4elPV7016ZDE9QzcyU9DtsKj/Hhpofk3YIOeyrQDb3Beq9Mc 9peomiEDyUKUMtJrmmHZb52AfN77CwqFtXECAQ8XHqiiw=; Received: (qmail 27610 invoked by alias); 20 Aug 2012 14:23:43 -0000 Received: (qmail 27598 invoked by uid 22791); 20 Aug 2012 14:23:42 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-gh0-f175.google.com (HELO mail-gh0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Aug 2012 14:23:26 +0000 Received: by ghbz2 with SMTP id z2so5307215ghb.20 for ; Mon, 20 Aug 2012 07:23:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:content-type:content-transfer-encoding:x-gm-message-state; bh=ruvrrK3CeiT29mZ9GY5O2gottvXm8AcDPuzTk4qUXCc=; b=gBgsP4+yGnSZ+2leepFigrnKtIV316hdabeDwAdA+3P2h0bE86poust2dLcS+C0fVH ajpsbn/XLlicbComU9Jlv2TQC8mgVMEYHgFvCShwWtcazKiLhq/u0JgyafTNiAK+S+QN gCeCddvvPC8AEKONs7W0kY0rnsq4F0lriKHJDIGQnNztrJvcJUznEaLFZzzPm3HkbCvT ywiOjpwst25at6pAChpxo02Js8pTVtREluzA3wlRbM71wduUhbhwPCQQMnWtyHt1dTEk IfdAvKqS9eJHFIqB08wrApNmtP+M++MeobAeenIxjGTdPm0vkj17DLQdroSNGSSlvguB rbaA== Received: by 10.50.160.195 with SMTP id xm3mr9846727igb.12.1345472605286; Mon, 20 Aug 2012 07:23:25 -0700 (PDT) Received: by 10.50.160.195 with SMTP id xm3mr9846708igb.12.1345472604972; Mon, 20 Aug 2012 07:23:24 -0700 (PDT) Received: from dhcp-172-29-42-175.tor.corp.google.com (dhcp-172-29-42-175.tor.corp.google.com [172.29.42.175]) by mx.google.com with ESMTPS id pp4sm25749505igb.5.2012.08.20.07.23.23 (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 07:23:24 -0700 (PDT) Message-ID: <50324860.2090306@google.com> Date: Mon, 20 Aug 2012 10:23:28 -0400 From: Diego Novillo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: gcc-patches CC: Jason Merrill Subject: Fix -ftime-report for C++ lookup X-Gm-Message-State: ALoCoQlG2pdMP74kcqe0LGiuXKd1Kx9iVHfSKJm8DFs9WK4aoOOALj3SU9BPShzFXHFJQ2+6Kd4T/V4OPAIaht6wYa9RNexQpPU71QAgJodWC/DMbZ5GB3YF6M7AqPY+6ZhCHKBUePYo9deFDdmS/kG5zeZTtAp4rZnrLDYlr05HeZPPwj0aBhLAnkJATSWi7ggi7BCh/ey/NVQvKzaWvX7d12wdG1I/7Q7snDcEotX+5tfRadWVRWg= 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 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 * 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; }