From patchwork Thu Jan 12 23:16:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: asharif@google.com X-Patchwork-Id: 135696 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 7BC7FB6EF7 for ; Fri, 13 Jan 2012 10:16:23 +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=1327014984; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Reply-To:Message-ID:Date:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=9WX8iYV 88hzcTrQ7DUDBYujSHDc=; b=cus/0QD9A81mT0ZT24aSwUpFCKiXFGY06UlfyvV Gk2jbpWuLuW8u4Y2qT+T5ctRUtYAypSLWsIKczEmivDj+oZsL23W0+yRJJABCBu1 f9XVD6Tuun8dvNkU0h92XMAaZ3e/bkVrUbxgj1BTse2oQOCql8dIGU3t0zL4wRzl r2fI= 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:Received:MIME-Version:Received:Reply-To:X-Google-Appengine-App-Id:Message-ID:Date:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=o1XA6h5+EY+S/bNXnMThXRlf7y35y/uoHAgMT5ZqLxM4Y4w15s+1zgO0aTdJdl YrZOrNHl/2Pr3mFRZvqY1FY1bnu1SBAuPAi0PLyuuaDpJVa65WiPmFUXseE6AfDa o9dP++Y9PnOlGSKnoogCmDSIRA4PgmYwZEbC46oBNumGY=; Received: (qmail 5444 invoked by alias); 12 Jan 2012 23:16:20 -0000 Received: (qmail 5423 invoked by uid 22791); 12 Jan 2012 23:16:17 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qw0-f69.google.com (HELO mail-qw0-f69.google.com) (209.85.216.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 23:16:04 +0000 Received: by qam2 with SMTP id 2so2349836qam.8 for ; Thu, 12 Jan 2012 15:16:03 -0800 (PST) Received: by 10.224.17.193 with SMTP id t1mr335428qaa.4.1326410163513; Thu, 12 Jan 2012 15:16:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.17.193 with SMTP id t1mr335387qaa.4.1326410163332; Thu, 12 Jan 2012 15:16:03 -0800 (PST) Reply-To: asharif@google.com, xur@google.com, shenhan@google.com, jingyu@google.com, gcc-patches@gcc.gnu.org, bjanakiraman@google.com, reply@codereview-hr.appspotmail.com X-Google-Appengine-App-Id: s~codereview-hr Message-ID: Date: Thu, 12 Jan 2012 23:16:03 +0000 Subject: Merged r183086 and r183143 from branches/google/gcc-4_6. (issue 5541046) From: asharif@google.com To: xur@google.com, shenhan@google.com, jingyu@google.com Cc: gcc-patches@gcc.gnu.org, bjanakiraman@google.com, reply@codereview-hr.appspotmail.com 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 Reviewers: xur, shenhan, jingyu, Message: This merges in the fix for ICE when using PGO when building Chrome. Please review this at http://codereview.appspot.com/5541046/ Affected files: M . M gcc/ChangeLog.google-4_6 M gcc/profile.c Index: . =================================================================== --- . (revision 183143) +++ . (working copy) Property changes on: . Index: gcc/ChangeLog.google-4_6 =================================================================== --- gcc/ChangeLog.google-4_6 (revision 183143) +++ gcc/ChangeLog.google-4_6 (working copy) @@ -1,3 +1,16 @@ +2012-01-12 Rong Xu + Backport r183142 from google/main + + * gcc/profile.c (compute_value_histograms): ignore the + histrogram when the counters not found in gcda file. + +2012-01-10 Rong Xu + + Backport r183081 from google/main + + * gcc/profile.c (compute_value_histograms): handle the + case when INDIR_CALL counters not available in gcda files. + 2011-12-19 Han Shen Add a new option "-fstack-protector-strong". * cfgexpand.c (expand_used_vars): Add logic handling Index: gcc/profile.c =================================================================== --- gcc/profile.c (revision 183143) +++ gcc/profile.c (working copy) @@ -790,9 +790,14 @@ gcov_type *histogram_counts[GCOV_N_VALUE_COUNTERS]; gcov_type *act_count[GCOV_N_VALUE_COUNTERS]; gcov_type *aact_count; + bool warned[GCOV_N_VALUE_COUNTERS]; + static const char *const ctr_names[] = GCOV_COUNTER_NAMES; for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++) - n_histogram_counters[t] = 0; + { + n_histogram_counters[t] = 0; + warned[t] = 0; + } for (i = 0; i < VEC_length (histogram_value, values); i++) { @@ -828,6 +833,19 @@ t = (int) hist->type; aact_count = act_count[t]; + /* If cannot find the counters in gcda file, skip and give + a warning. */ + if (aact_count == 0) + { + if (!warned[t] && flag_opt_info >= OPT_INFO_MIN) + warning (0, "cannot find %s counters in function %s.", + ctr_names[COUNTER_FOR_HIST_TYPE(t)], + IDENTIFIER_POINTER ( + DECL_ASSEMBLER_NAME (current_function_decl))); + hist->n_counters = 0; + warned[t] = true; + continue; + } act_count[t] += hist->n_counters; gimple_add_histogram_value (cfun, stmt, hist);