From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9481 invoked by alias); 8 Jul 2010 19:19:21 -0000 Received: (qmail 9472 invoked by uid 22791); 8 Jul 2010 19:19:21 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jul 2010 19:19:17 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o68JJFJH017468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 8 Jul 2010 15:19:15 -0400 Received: from anchor.twiddle.home (vpn-227-19.phx2.redhat.com [10.3.227.19]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o68JJFYi007256; Thu, 8 Jul 2010 15:19:15 -0400 Message-ID: <4C3624B2.9070602@redhat.com> Date: Thu, 08 Jul 2010 19:19:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5 MIME-Version: 1.0 To: IainS CC: GCC Patches , Diego Novillo , Jan Hubicka , Jakub Jelinek Subject: Re: [Patch, updated] Make emulated TLS lto-friendly. References: <4C350C25.2030308@redhat.com> <54190C7D-E4F8-4D84-A468-E38B39770D3F@sandoe-acoustics.co.uk> In-Reply-To: <54190C7D-E4F8-4D84-A468-E38B39770D3F@sandoe-acoustics.co.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-07/txt/msg00709.txt.bz2 On 07/08/2010 12:07 PM, IainS wrote: > > On 8 Jul 2010, at 00:22, Richard Henderson wrote: >> Do you really need this kind of thing anymore, since you're exposing >> the use of the control variable so early? I would have thought that >> varpool.c would no longer need any special-casing for !have_tls. > > this is my understanding (which might be flawed &| incomplete). > > Whilst we are on the parse side - and building varpool & cgraph, the > relationship is not fully exposed (that happens when gimplication is done). > > So my reasoning was that the "ghost/proxy" vars should be made to track > the user-land ones until then. Hmm. So what you're saying is that there's extra cleanup work that needs to happen while lowering the representation. It's not merely a matter of code substitution during gimplification. In which case I wonder if it wouldn't be better to do as Honza suggested and separate all of this out into a new pass_lower_emutls. Perhaps to be placed just after pass_lower_vector. That placement is before pass_build_cgraph_edges, which I believe means you would not have to fix up the cgraph edges for the new function calls. All you'd need to do is transform the tls variable references and fix up the varpool references. Honza, thoughts here? r~