From patchwork Tue May 7 17:55:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 242431 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 "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id BA98A2C017E for ; Wed, 8 May 2013 03:55:56 +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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=SQJT6UwB0+YtXfbx5ORQVddsXOWk9ScPAy47brqO2PGeu2dP3r 4mhukYuB/bzXhMJxZt1VHclhBlhrGsK8GHSOcDoMQb2IV8VEgF32wifC+lTC5rqQ 6hjvpSeOHEjrLhn0o2ygAzGCEJLlsZWDS+65zU791P88mnAFYCWmjEFck= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=3kCqayI/7Nw8mwRS/G3WvHQfVZM=; b=nWUpWpjkLlHDAUEzw+mZ 1AxSnq5tw/63eO7o+zuOHBfeVdbWQDVh3EBn2XScwhNqN8b52mO5CzYk8wPdSXpO yjV8rPvZ6RYJ5mkiwEax4UAmtvFykSkiuTgcWQ0Bvg8Bhf6yxp0puhmugwKCbRH3 oksrbrRN4b6I8IiNpV7xDVc= Received: (qmail 17468 invoked by alias); 7 May 2013 17:55:50 -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 17457 invoked by uid 89); 7 May 2013 17:55:50 -0000 X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.1 Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 17:55:49 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A53A1A3DDF; Tue, 7 May 2013 19:55:47 +0200 (CEST) Date: Tue, 7 May 2013 19:55:47 +0200 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH, PR 57084] Create real cgraph node during late intraprocedural devirtualization Message-ID: <20130507175546.GB3568@virgil.suse> Mail-Followup-To: GCC Patches , Jan Hubicka MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, the problem in PR 57084 is that late PRE devirtualization creates a direct call to a decl fro which we only have an inlined call graph mode in the given partition. I tried to find a most universal place where to fix it because this problem is not special to type-based devirtualization and in theory can be caused by any call to a decl that is grabbed from a constructor. I think the best place is the following one-liner, because all such decls should go through canonicalize_constructor_val. Bootstrapped and tested on x86_64-linux, fixes the testcase (at -m32) and I have happened to also LTO build Mozilla Firefox with it. OK for trunk? Thanks, Martin 2013-05-06 Martin Jambor PR lto/57084 * gimple-fold.c (canonicalize_constructor_val): Call cgraph_get_create_real_symbol_node instead of cgraph_get_create_node. Index: src/gcc/gimple-fold.c =================================================================== --- src.orig/gcc/gimple-fold.c +++ src/gcc/gimple-fold.c @@ -178,7 +178,7 @@ canonicalize_constructor_val (tree cval, /* Make sure we create a cgraph node for functions we'll reference. They can be non-existent if the reference comes from an entry of an external vtable for example. */ - cgraph_get_create_node (base); + cgraph_get_create_real_symbol_node (base); } /* Fixup types in global initializers. */ if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))