From patchwork Tue Jul 4 10:17:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 783854 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x20Lw63N6z9s65 for ; Tue, 4 Jul 2017 20:18:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="H2lBQlou"; dkim-atps=neutral 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=WXpaQCkEQQ7UnjSS1N3MXxwmIpevTsClzKDuRe2k3wbnPDyq8D4vw /z/eC+eDHbPvZykHfIonkTRsIb0vbgSHxX5kpEy0M6iwCH5h863wZ23zdzRdzrDU 8RF+d1gJwDTH+luSZEb+/vCknAlT+b0k8WIC237agCAa7iQGlaNop4= 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=59UIzGDpDU0IDNMPavx7Uv7iOBI=; b=H2lBQlouK4JRvsVQ1gSb Kkq9MOvDWTOciA2VcKGi9zVTXX5NvI1QLhweCjadMoTI1M50ltfGOgGncJroC2by rm4ZPWtb7Yts0Gz/aXnWeLoH3FY6y4c6U1trp2iVDPb0XcqS13E1gttr7Kms3Us3 Ptm4O9CMQ+zK34jm5W8YvN8= Received: (qmail 85535 invoked by alias); 4 Jul 2017 10:17:51 -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 85522 invoked by uid 89); 4 Jul 2017 10:17:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-14.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=deflate, our 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; Tue, 04 Jul 2017 10:17:48 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 2D3F4547DF2; Tue, 4 Jul 2017 12:17:46 +0200 (CEST) Date: Tue, 4 Jul 2017 12:17:46 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix bb-reorder code size regression on Itanium Message-ID: <20170704101746.GB14843@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Hi, better_edge_p will always return false when best_prob is uninitialized. This patch makes it to chose first edge with initialized probability instead. This solves code size regression seen on our Itanium tester at least for gzip's deflate. Will commit it after bootstrapping/regtesting x86_64-linux. Honza * bb-reorder.c (better_edge_p): Deal with uninitialized best_prob. Index: bb-reorder.c =================================================================== --- bb-reorder.c (revision 249928) +++ bb-reorder.c (working copy) @@ -957,7 +957,7 @@ better_edge_p (const_basic_block bb, con return !cur_best_edge || cur_best_edge->dest->index > e->dest->index; - if (prob > best_prob + diff_prob) + if (prob > best_prob + diff_prob || !best_prob.initialized_p ()) /* The edge has higher probability than the temporary best edge. */ is_better_edge = true; else if (prob < best_prob - diff_prob)