From patchwork Fri Dec 16 22:37:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 131930 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 7AA351007D7 for ; Sat, 17 Dec 2011 09:37:33 +1100 (EST) Received: (qmail 10443 invoked by alias); 16 Dec 2011 22:37:30 -0000 Received: (qmail 10317 invoked by uid 22791); 16 Dec 2011 22:37:29 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ey0-f201.google.com (HELO mail-ey0-f201.google.com) (209.85.215.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Dec 2011 22:37:16 +0000 Received: by eaan10 with SMTP id n10so106024eaa.2 for ; Fri, 16 Dec 2011 14:37:15 -0800 (PST) Received: by 10.213.34.79 with SMTP id k15mr209153ebd.9.1324075034892; Fri, 16 Dec 2011 14:37:14 -0800 (PST) Received: by 10.213.34.79 with SMTP id k15mr209145ebd.9.1324075034676; Fri, 16 Dec 2011 14:37:14 -0800 (PST) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id q50si451746eef.3.2011.12.16.14.37.14 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 16 Dec 2011 14:37:14 -0800 (PST) Received: from rong.mtv.corp.google.com (rong.mtv.corp.google.com [172.18.110.233]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 7942C5C0050; Fri, 16 Dec 2011 14:37:14 -0800 (PST) Received: by rong.mtv.corp.google.com (Postfix, from userid 104659) id C6D38C160A; Fri, 16 Dec 2011 14:37:13 -0800 (PST) To: reply@codereview.appspotmail.com,gcc-patches@gcc.gnu.org Subject: [google] fix insane runs in gcda file (issue5490057) Message-Id: <20111216223713.C6D38C160A@rong.mtv.corp.google.com> Date: Fri, 16 Dec 2011 14:37:13 -0800 (PST) From: xur@google.com (Rong Xu) 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 Hi, This patch fixes the insane values in runs and run_max field of the program summary. This can happen when the gcda files manually removed from the output directory after the merge happens. This is for google branch only. Tested with (make; make check). -Rong 2011-12-16 Rong Xu * libgcc/libgcov.c (gcov_merge_gcda_file): reset summary_pos. --- This patch is available for review at http://codereview.appspot.com/5490057 Index: libgcc/libgcov.c =================================================================== --- libgcc/libgcov.c (revision 182398) +++ libgcc/libgcov.c (working copy) @@ -810,6 +810,7 @@ gcov_unsigned_t tag, length; eof_pos = 0; + summary_pos = 0; tag = gcov_read_unsigned (); if (tag)