From patchwork Thu Nov 28 17:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1202228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-514786-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LeYVB/N2"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47P3vD0Ntvz9sP3 for ; Fri, 29 Nov 2019 04:06:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ZPzo/FnFQJp38D1S4ujaI89oTsvcXWwBesaziCaDjx7aq1I7tomil D0vxMudHeRYY0uMS+CHn13AF8rkgrsbnKYn5uuQwa92DVpFxvBO6WFhzDfYy+NU3 +PXN+P/X5c/MNv+oh+ktMBOrhO7OELJ02JxE/8/9Ry5gf4ct3y5fgY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=ib2nSqkEeHo7mB6dRSSM3X3qZVo=; b=LeYVB/N27jfW2HMH1L9O AuLsZs1NKlLaiiKp1x6ZaFaC4hmnN3yiGVb3Kk2AtYJ2BbYRNdlJphI+GasSky5Q KY8NxFnBTvXlQM59cA3s+oonuZtSaP9ZBp8yDSbWVnvK+QSgOf0w68T5rPdXm3E2 eHI02IiPAgI0yskaO3G+lss= Received: (qmail 7967 invoked by alias); 28 Nov 2019 17:06:08 -0000 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 Received: (qmail 7959 invoked by uid 89); 28 Nov 2019 17:06:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Nov 2019 17:06:07 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id B4B69280823; Thu, 28 Nov 2019 18:06:05 +0100 (CET) Date: Thu, 28 Nov 2019 18:06:05 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Minor fix for profile_count::combine_with_ipa_count Message-ID: <20191128170605.uvkuipsxgusyhj3x@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this patch makes combine_with_ipa_count to return uninitialized when called on uninitialized count. Previously in some cases it returned IPA, which is probably not a big deal but it should not do that for consistency. Bootstrapped/regtested x86_64-linux, comitted. * profile-count.c (profile_count::combine_with_ipa_count): Return uninitialized count if called on ininitialized count. Index: profile-count.c =================================================================== --- profile-count.c (revision 278814) +++ profile-count.c (working copy) @@ -373,6 +376,8 @@ profile_count::adjust_for_ipa_scaling (p profile_count profile_count::combine_with_ipa_count (profile_count ipa) { + if (!initialized_p ()) + return *this; ipa = ipa.ipa (); if (ipa.nonzero_p ()) return ipa;