From patchwork Fri Dec 14 06:42:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 206301 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 1668F2C008D for ; Fri, 14 Dec 2012 17:43:02 +1100 (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=1356072183; h=Comment: DomainKey-Signature: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=rfrH7OwZYMt1tuAQF6P4 XKulOog=; b=j4ludxzkfCh/z7wiOTtFzyazcEevfGY4iNuwzix6sZgw3OzD4r2l edNou9/8G1wBHPKmsVqDkvhuCnNW7krs3ZKG3JmgKhe3GkZyZV9iS9zSmNnpqinM ncKtapf8TERtMil8tz0ZONvXziJRHCn/FfwzvaOBc/u8wHHEbaaq8Xc= 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: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=yfAtiTIFo6nX+5pSvoayrtCsuLnoYERH+1/qel3WKi3pRKKECkKLeCnp+vfQvA /ygSmGjJYalG6k4zpJgakrGjN8PtJMSiQT97s9e0XkqNP5vc+K9VVX4kXbNUwfHf J0ceCJu6MTrnDummYonLziVhIsVyn4ouvzxlaJsGxlxrE=; Received: (qmail 29824 invoked by alias); 14 Dec 2012 06:42:54 -0000 Received: (qmail 29814 invoked by uid 22791); 14 Dec 2012 06:42:52 -0000 X-SWARE-Spam-Status: No, hits=-4.5 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-wi0-f201.google.com (HELO mail-wi0-f201.google.com) (209.85.212.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Dec 2012 06:42:45 +0000 Received: by mail-wi0-f201.google.com with SMTP id hm2so17781wib.2 for ; Thu, 13 Dec 2012 22:42:43 -0800 (PST) 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=IZeZZB/hdzSaFsdcH/1GginIJQkRNrRap3RUn8UJGzI=; b=esY1M/7glG+vcl9K66fJvcJO2qwYEawh91kOq1bbyHE3+sjANEg9VEy8KKukSNMVfR qEHYQtNzCXlZ5pFrON110uShoeHrLdilZ5I1BMwfj8Kp8yRiwlmXaXKfTEe2a8id1/xs /PPdD2U+fA1bHw9kCnUc7JuK+HRTNR1BqG5X73f0ctAiVJam+MVX0IPFTBdevjdJGORp 1ytYXvqCxQEWCBkdJZdjPaODCeRirfa5BZh5tlMRp6wxACV1EorWf1NKX62Bk0ISnJb+ U7nfEd26Sy3P2kZanE2lAIdqIUa/7VfsBqlAzSVFciaGWAzqnAtycseKPnHP1iJezuJb YBDQ== Received: by 10.14.0.196 with SMTP id 44mr4597350eeb.6.1355467363612; Thu, 13 Dec 2012 22:42:43 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id z44si959983een.0.2012.12.13.22.42.43 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 13 Dec 2012 22:42:43 -0800 (PST) Received: from tjsboxrox.mtv.corp.google.com (tjsboxrox.mtv.corp.google.com [172.17.129.49]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 3F7C9200059; Thu, 13 Dec 2012 22:42:43 -0800 (PST) Received: by tjsboxrox.mtv.corp.google.com (Postfix, from userid 147431) id 3ECDA615D9; Thu, 13 Dec 2012 22:42:41 -0800 (PST) To: reply@codereview.appspotmail.com, hubicka@ucw.cz, markus@trippelsdorf.de, gcc-patches@gcc.gnu.org Subject: [PATCH] Fix LTO binary size increases (PR gcov-profile/55674) (issue6946049) Message-Id: <20121214064242.3ECDA615D9@tjsboxrox.mtv.corp.google.com> Date: Thu, 13 Dec 2012 22:42:41 -0800 (PST) From: tejohnson@google.com (Teresa Johnson) X-Gm-Message-State: ALoCoQnzBqzTiJe7CjcnPqJUkCZwLMohFhT1qLN135OYbx/qHX/caQhE/UtEAEs7HJ6EMeM5yqo/t2qFlF+j7nc6/tBCW3/uLAzVNxlucSht/+kqlms77nO9yfrCFDiEd7BoMUMO4EoP93vXbF4FQtI9DDL0DinwkaRHw3FYaUqqRGCDITFuePq0cE3e5Mp9G/PaSRW2X97E 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 2012-12-13 Teresa Johnson PR gcov-profile/55674 * lto-cgraph.c (merge_profile_summaries): Set min correctly the first time we merge into a histogram entry. --- This patch is available for review at http://codereview.appspot.com/6946049 Index: lto-cgraph.c =================================================================== --- lto-cgraph.c (revision 194496) +++ lto-cgraph.c (working copy) @@ -1368,7 +1368,9 @@ merge_profile_summaries (struct lto_file_decl_data so we need to account for a non-zero histogram entry at new_ix. */ unsigned new_ix = gcov_histo_index (scaled_min); lto_gcov_summary.histogram[new_ix].min_value - = MIN (lto_gcov_summary.histogram[new_ix].min_value, scaled_min); + = (lto_gcov_summary.histogram[new_ix].num_counters + ? MIN (lto_gcov_summary.histogram[new_ix].min_value, scaled_min) + : scaled_min); /* Some of the scaled counter values would ostensibly need to be placed into different (larger) histogram buckets, but we keep things simple here and place the scaled cumulative counter value in the bucket