From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14294 invoked by alias); 11 Oct 2010 15:08:28 -0000 Received: (qmail 14272 invoked by uid 22791); 11 Oct 2010 15:08:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Oct 2010 15:08:22 +0000 Received: from localhost (occam.ms.mff.cuni.cz [195.113.18.121]) by nikam.ms.mff.cuni.cz (Postfix) with ESMTP id E41919AC737; Mon, 11 Oct 2010 17:08:19 +0200 (CEST) Received: by localhost (Postfix, from userid 16202) id D70CF5641BC; Mon, 11 Oct 2010 17:08:19 +0200 (CEST) Date: Mon, 11 Oct 2010 15:09:00 -0000 From: Jan Hubicka To: GCC Patches , Richard Guenther , Jan Hubicka Subject: Re: [PATCH, PR 45699] Devirtualize to thunks Message-ID: <20101011150819.GA29587@kam.mff.cuni.cz> References: <20101011133014.GA12977@virgil.arch.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101011133014.GA12977@virgil.arch.suse.de> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg00919.txt.bz2 > Hi, > > folding of OBJ_TYPE_REFs just takes the function declaration in BINFOs > and puts into the call statement. Unfortunately BINFOs do not put the > declaration of the proper thunk there and so we might ending up not > adjusting the this pointer like in the testcase below. On the other > hand, BINFOs do contain the deltas and so the folding code can look up > the right thunk in the call graph if need be. This is what the patch > below does. > > Bootstrapped and tested on x86_64-linux without any issues. OK for > trunk? I guess we should also add an folder that transforms calls to thunk to call to the function so inlining and other IPA stuff work? At the moment i think both ipa-prop and inliner will get direct calls to thunks wrong. Honza