From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13671 invoked by alias); 3 Apr 2015 18:49:20 -0000 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 Received: (qmail 13662 invoked by uid 89); 3 Apr 2015 18:49:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: atrey.karlin.mff.cuni.cz Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Apr 2015 18:49:18 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 019CF81F0A; Fri, 3 Apr 2015 20:49:15 +0200 (CEST) Date: Fri, 03 Apr 2015 18:49:00 -0000 From: Jan Hubicka To: Ilya Enkovich Cc: Jan Hubicka , gcc-patches Subject: Re: [CHKP, PATCH] Fix LTO cgraph merge for instrumented functions Message-ID: <20150403184915.GS21276@atrey.karlin.mff.cuni.cz> References: <20150312102706.GL27860@msticlxl57.ims.intel.com> <20150319083455.GD64546@msticlxl57.ims.intel.com> <20150402170115.GB21276@atrey.karlin.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00140.txt.bz2 > Assembler name of instrumented function is a transparent alias of > original function's name. Alias chains are not taken into account by > analysis. Thus we see no conflict between instrumented function's name > and a variable name but emit them with the same assembler name. To > detect name conflict I keep original function node alive. Hmm, so lets see if I understand your situation. You always have transparent alias TA and function F connected by IPA_REF_CHKP and because TA is represented as thunk you also have a fake call from TA to F? I do not understand how you can miss the link these days. I extended lto-cgraph to always keep thunk and its target in every unit that reffers to thunk. That should solve you problem? How IPA_REF_CHKP can link get lost? I suppose we still need to 1) write_symbol and lto-symtab should know that transparent aliases are not real symbols and ignore them. We have predicate symtab_node::real_symbol_p, I suppose it should return true. I think cgraph_merge and varpool_merge in lto-symtab needs to know what to do when merging two symbols with transparent aliases. 2) At some point we need to populate transparent alias links as discussed in the other thread. 3) For safety, I guess we want symbol_table::change_decl_assembler_name to either sanity check there are no trasparent alias links pointing to old assembler names or update it. 4) I think we want verify_node to check that transparent alias links and chkp points as intended and only on those symbols where they need to be There is also logic in lto-partition to always insert alias target > > OK, so you have the chkp references that links to instrumented_version. > > You do not stream them for boundary symbols but for some reason they are needed, > > but when you can end up with wrong CHKP link? > > Wrong links may appear when cgraph nodes are merged. I see, I think you really want to fix these at merging time as sugested in 1). In this case even the node->instrumented_version pointer may be out of date and point to a node that lost in merging? Honza > > Thanks > Ilya