From patchwork Fri Aug 23 15:56:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 269485 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 6FAC62C0099 for ; Sat, 24 Aug 2013 01:56:27 +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:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=ED/psSKnPj67n6pdd YZhA8qO8Ol1yN/PcHkrfliFpyTx4ePTK8hdmubjUwxikKJ6zfydw2ieLqBDGBZxO NcqgFPbuqwcK57gOTbJptrcybKJ3Qqjrnyw7C09CRF9i0KaSRTuyHKne5D1jWABg ASerm1ZNruoh0orsS3S07+OZhk= 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:references:mime-version :content-type:in-reply-to; s=default; bh=G58vNtm7TePKD+b7+0H1YaA EO70=; b=XP8su42EUPi0qB4w4C0KFdz0ZYGMvHLcK20a4x4UAImNiV2gmhEKvK9 K+m2+Qyp3ouxvBP+gJ5YkRrg/nWKC7dOxDFmVbWrUCCm9rqT7bQ5mK0qoRx5tNZQ MRxQa3dAsoHJSa5Dq4rONyf8ahn2Ip030+LQnsglkIA8QkOouou4= Received: (qmail 30925 invoked by alias); 23 Aug 2013 15:56:10 -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 30877 invoked by uid 89); 23 Aug 2013 15:56:09 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD autolearn=ham version=3.3.2 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 23 Aug 2013 15:56:09 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 236E954394F; Fri, 23 Aug 2013 17:56:07 +0200 (CEST) Date: Fri, 23 Aug 2013 17:56:07 +0200 From: Jan Hubicka To: Graham Stott Cc: Jan Hubicka , "gcc-patches@gcc.gnu.org" , "jason@redhat.com" , "mjambor@suse.cz" , "rguenther@suse.de" Subject: Re: Type inheritance graph analysis & speculative devirtualization, part 4a/6 simple anonymous namespace devirtualization during cgraph construction Message-ID: <20130823155606.GA12817@kam.mff.cuni.cz> References: <20130823151254.GA6192@kam.mff.cuni.cz> <1377272890.82390.YahooMailNeo@web87403.mail.ir2.yahoo.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1377272890.82390.YahooMailNeo@web87403.mail.ir2.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) > Jan, > > This has broken all builds because method_type_class() is defined. Oops, sorry for that. I happened to make partial diff only. This patch adds the missing bit. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 201943) +++ ChangeLog (working copy) @@ -1,5 +1,8 @@ 2013-08-23 Jan Hubicka + * ipa-utils.h (method_class_type): Declare. + * ipa-devirt.c (method_class_type): Export. + * cgraphunit.c (analyze_functions): Do basic devirtualization; do not walk base classes of anonymous types. Index: ipa-devirt.c =================================================================== --- ipa-devirt.c (revision 201919) +++ ipa-devirt.c (working copy) @@ -342,7 +342,7 @@ dump_type_inheritance_graph (FILE *f) /* Given method type T, return type of class it belongs to. Lookup this pointer and get its type. */ -static tree +tree method_class_type (tree t) { tree first_parm_type = TREE_VALUE (TYPE_ARG_TYPES (t)); Index: ipa-utils.h =================================================================== --- ipa-utils.h (revision 201919) +++ ipa-utils.h (working copy) @@ -59,6 +59,7 @@ odr_type get_odr_type (tree, bool insert void dump_possible_polymorphic_call_targets (FILE *, tree, HOST_WIDE_INT); bool possible_polymorphic_call_target_p (tree, HOST_WIDE_INT, struct cgraph_node *n); +tree method_class_type (tree); /* Return vector containing possible targets of polymorphic call E. If FINALP is non-NULL, store true if the list is complette.