From patchwork Fri Sep 7 05:51:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 182323 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 64F522C0086 for ; Fri, 7 Sep 2012 15:51:37 +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=1347601898; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=wup0EP0 6wGhyk20Jxq/DR4IPYic=; b=DNQrOw9CbHrpxvE4UwrOjiOkLAUj5d2llgUwo75 DQSLcoF+xAevrR3ehuR83b0TpVb+9GVixy4zRx3GNCqmLeyJpjNRqDsMtJ/l9viq yG9ygE2Wzm7M7NfidxbSAd6dVel1zYm/f7AYnSpYW3/VwKS6PPkyZ3eVEjb3vWRa UK2o= 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:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jYNNDH1f5sUDnGABYctjOqo/TklhC9PHYMjWChWnHgu84/j1MXwq7chyVpbvcP gEY+KPepinf7XbMpt6r4ZFdPZj/BqYMO/t58pUEWOqP71M3D9INE8YwLmt6oqeyd EqFwltR0SwhyQ2706MBLhWMixL2LsjEzd9jHQrlNsRxkI=; Received: (qmail 18533 invoked by alias); 7 Sep 2012 05:51:33 -0000 Received: (qmail 18523 invoked by uid 22791); 7 Sep 2012 05:51:32 -0000 X-SWARE-Spam-Status: No, hits=-3.7 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, TW_CP, URIBL_DBL_REDIR X-Spam-Check-By: sourceware.org Received: from mail-yw0-f74.google.com (HELO mail-yw0-f74.google.com) (209.85.213.74) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Sep 2012 05:51:19 +0000 Received: by yhl10 with SMTP id 10so291217yhl.5 for ; Thu, 06 Sep 2012 22:51:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=8rJ9DzSYDmCKZ5F2SAGZma7gPFEiBmIn2TAx5Xnd4KQ=; b=VdHeArmlz2OW9mg8L0uUqxlhXrME8gmRMRSx2ixA/Xa38FXfZe3BVANNtM27SO5GcS GQqA/Aznd4ZqbBVKcsBluguFsFwDgoRIwwVcc4wiFPvNCz9RGlwiG+5nP8cQHf62ZJCU vGn+DAnJQmimaOokcK7Ywk4CR1nv1xBNnwmW5jdP4i9+QNCgR9CPsiC0bC27pPgfYMSy NLAAJMQcBR3RL7buZwbFGXQlveYWmTAl31mtxuL8mLwB0XsB4ihnTD6awTTxKYDJDyoA UMe5qfGdFnTSmAbLGz7UBTPh3APaIcUK0e/wadV+LTf9zR2/NRhIUQUSDNQ2XANP/Zt7 z+3g== Received: by 10.236.190.104 with SMTP id d68mr2461481yhn.45.1346997078398; Thu, 06 Sep 2012 22:51:18 -0700 (PDT) Received: by 10.236.190.104 with SMTP id d68mr2461475yhn.45.1346997078347; Thu, 06 Sep 2012 22:51:18 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id y43si1184518yhi.2.2012.09.06.22.51.18 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 06 Sep 2012 22:51:18 -0700 (PDT) Received: from tjsboxrox.mtv.corp.google.com (tjsboxrox.mtv.corp.google.com [172.18.110.68]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 29CF6100047; Thu, 6 Sep 2012 22:51:18 -0700 (PDT) Received: by tjsboxrox.mtv.corp.google.com (Postfix, from userid 147431) id 8F47D61464; Thu, 6 Sep 2012 22:51:17 -0700 (PDT) To: reply@codereview.appspotmail.com, hubicka@ucw.cz, markus@trippelsdorf.de, hjl.tools@gmail.com, gcc-patches@gcc.gnu.org Subject: [PATCH] Fix part of PR gcov-profile/54487 (issue6501100) Message-Id: <20120907055117.8F47D61464@tjsboxrox.mtv.corp.google.com> Date: Thu, 6 Sep 2012 22:51:17 -0700 (PDT) From: tejohnson@google.com (Teresa Johnson) X-Gm-Message-State: ALoCoQnUTDW6rkX1XrS0lRhGz03uzE5RuA/l9qGkx1v3r5HUQ+/tbL5HpNcHn7yDmjl085bGURLQT6xP3hMIioWOgx3DdGKQsBffO+816C6Z1ZMC0FL06JSYv8Jt/XsBD5T4Y22dhxdK+wg1IasnEgg8EXWDIdf0slGDkEogmvR+y+Iw5JFsVNQnyZEvYgviB0Q+s6ngopm/ 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 This fixes part of the issue described in PR gcov-profile/54487 where there were warnings about mismatches due to slight differences in the merged histograms in different object files. This can happen due to the truncating integer division in the merge routine, which could result in slightly different histograms when summaries are merged in different orders. Tested with bootstrap and profiledbootstrap on x86_64-unknown-linux-gnu. Ok for trunk? Teresa 2012-09-06 Teresa Johnson PR gcov-profile/54487 * libgcc/libgcov.c (gcov_exit): Avoid warning on histogram differences. --- This patch is available for review at http://codereview.appspot.com/6501100 Index: libgcc/libgcov.c =================================================================== --- libgcc/libgcov.c (revision 191035) +++ libgcc/libgcov.c (working copy) @@ -707,7 +707,13 @@ gcov_exit (void) memcpy (cs_all, cs_prg, sizeof (*cs_all)); else if (!all_prg.checksum && (!GCOV_LOCKED || cs_all->runs == cs_prg->runs) - && memcmp (cs_all, cs_prg, sizeof (*cs_all))) + /* Don't compare the histograms, which may have slight + variations depending on the order they were updated + due to the truncating integer divides used in the + merge. */ + && memcmp (cs_all, cs_prg, + sizeof (*cs_all) - (sizeof (gcov_bucket_type) + * GCOV_HISTOGRAM_SIZE))) { fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s\n", gi_filename, GCOV_LOCKED