From patchwork Thu Mar 1 12:53:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 143999 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 8B0CD1007D3 for ; Thu, 1 Mar 2012 23:53:26 +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=1331211206; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:Mail-Followup-To:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=4QIi/61B51EzP68ThbBFApm+ar0=; b=FhetGAoqSAv3Mmw7rEDxyOmnLrS7Z+06uJdPY1+nM7FCLg7Mz7eNjd5OipXAfH IL8QqprjQ3r3R4x4tUm+mD2pC9e2oAxWzyn7s5ERAuLXPAAQhQAk9ebC+W+j7HX5 K85SZZCL1m7pO1T1XrVu7NnDRFpaTSubzU3GyUB1qUVuM= 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:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=h8kWPwjqg1wg2RO1DaP6w/rgzi52MrjH31J17LeH7NLczxkobYih2wP2ajBPwY CzU/T3fNEZWzNZgc8QbUPL4n1+ZXi2Wem5fBgJj8WArem4y8hxpkq0jB5bfpk0iy Llly9u4CMmLg2AwEeRk32DFTuGkoHbJ48X8oL4dSNGT7Y=; Received: (qmail 28733 invoked by alias); 1 Mar 2012 12:53:23 -0000 Received: (qmail 28724 invoked by uid 22791); 1 Mar 2012 12:53:22 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Mar 2012 12:53:09 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id DED3191C69; Thu, 1 Mar 2012 13:53:07 +0100 (CET) Date: Thu, 1 Mar 2012 13:53:07 +0100 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH, 4.4, PR 52430] IPA-CP has to clone or leave alone externally_visible nodes Message-ID: <20120301125307.GA9390@virgil.arch.suse.de> Mail-Followup-To: GCC Patches , Jan Hubicka MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, the following patch backports 4.5 behavior to 4.4 IPA-CP initialization when it decides which nodes need to be duplicated (we often say cloned, but cloning is an overloaded term in gcc) in order to modify them. In 4.5, this is decided by a new predicate called cgraph_only_called_directly_p which checks both node->needed and node->local.externally_visible, whereas 4.4 looks only at the needed flag. As described in the PR, this wrecks havoc for ipcp_update_callgraph which is the stage of the old IPA-CP when it undoes its decisions which turned out not to be safe. Bootstrapped and tested on x86_64-linux, OK for the branch? Thanks, Martin 2012-02-29 Martin Jambor PR tree-optimization/52430 * ipa-cp.c (ipcp_initialize_node_lattices): Also consider node->local.externally_visible as needed. Index: gcc/ipa-cp.c =================================================================== --- gcc/ipa-cp.c (revision 184662) +++ gcc/ipa-cp.c (working copy) @@ -508,7 +508,7 @@ ipcp_initialize_node_lattices (struct cg if (ipa_is_called_with_var_arguments (info)) type = IPA_BOTTOM; - else if (!node->needed) + else if (!node->needed && !node->local.externally_visible) type = IPA_TOP; /* When cloning is allowed, we can assume that externally visible functions are not called. We will compensate this by cloning later. */