From patchwork Sat Aug 31 14:05:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 271535 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id EADDF2C0077 for ; Sun, 1 Sep 2013 00:06:02 +1000 (EST) 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=ckUdVuXGYFa9+v6e235u4EUgPm6wFaZzXuZaIzsWxr3gK/4zm5SFL JLaC4NumS8nrhLvh5VI2J42+jwlVeueCWK6TPPkp+JKoU5PshfCv6WXa1CPTINle v9/X1KjYN4ie8TJtF+qs0zMaIFe9vKc2AW5bS3TIOamYkMIN06rmLA= 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=uaQqePjKvVp8ZuNYPziB4buJzYE=; b=AfZxRLYbmMO9ffbROyzh Me7NCqGlRY9UpxzO7N469wuIDnr1ewvT+6uFUyehzd1pKe/RdwgBhG1C4POGoZzj Dohi3sg+BfrhLDY52WVzib9hepi9oa57aI0jldZ7H76Hov/ypsQ3bfbO0ZPhBeqv EnTX4e1a2GQRrPMrcLnaWLs= Received: (qmail 23965 invoked by alias); 31 Aug 2013 14:05:57 -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 23955 invoked by uid 89); 31 Aug 2013 14:05:56 -0000 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 (AES256-SHA encrypted) ESMTPS; Sat, 31 Aug 2013 14:05:56 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, NO_RELAYS autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 095335432D3; Sat, 31 Aug 2013 16:05:52 +0200 (CEST) Date: Sat, 31 Aug 2013 16:05:52 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix speculative edge reference lookup Message-ID: <20130831140552.GD12966@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, this patch fixes ugly thinko when looking up reference for a speculative call. Without LTO we can end up choosing wrong alternative for function with many devirtualizations (as it happens for PPC64) Bootstrapped/regtested ppc64-linux, comitted. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 202128) +++ ChangeLog (working copy) @@ -1,5 +1,9 @@ 2013-08-31 Jan Hubicka + * cgraph.c (cgraph_speculative_call_info): Fix ref lookup + +2013-08-31 Jan Hubicka + * basic-block.h (apply_scale): Make scale parmeter gcov_type. 2013-08-31 Uros Bizjak Index: cgraph.c =================================================================== --- cgraph.c (revision 202100) +++ cgraph.c (working copy) @@ -1151,7 +1151,7 @@ cgraph_speculative_call_info (struct cgr i, ref); i++) if (ref->speculative && ((ref->stmt && ref->stmt == e->call_stmt) - || (ref->lto_stmt_uid == e->lto_stmt_uid))) + || (!ref->stmt && ref->lto_stmt_uid == e->lto_stmt_uid))) { reference = ref; break;