From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22184 invoked by alias); 6 Nov 2014 13:04:48 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 22102 invoked by uid 89); 6 Nov 2014 13:04:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=unavailable version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 06 Nov 2014 13:04:47 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA6D4dC1011731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Nov 2014 08:04:39 -0500 Received: from pike.twiddle.home (vpn1-7-101.ams2.redhat.com [10.36.7.101]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA6D4Kt0022592; Thu, 6 Nov 2014 08:04:24 -0500 Message-ID: <545B71D1.1090406@redhat.com> Date: Thu, 06 Nov 2014 13:04:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "Lynn A. Boger" , gcc-patches@gcc.gnu.org, libffi-discuss@sourceware.org, gofrontend-dev@googlegroups.com, ian@airs.com Subject: Re: [PATCH 00/13] Go closures, libffi, and the static chain References: <1412973773-3942-1-git-send-email-rth@redhat.com> <545A97BA.3030507@linux.vnet.ibm.com> <545B1C44.3000306@redhat.com> <20141106124838.GJ30857@bubble.grove.modra.org> In-Reply-To: <20141106124838.GJ30857@bubble.grove.modra.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00183.txt.bz2 On 11/06/2014 01:48 PM, Alan Modra wrote: > On Thu, Nov 06, 2014 at 07:59:16AM +0100, Richard Henderson wrote: >> I haven't done powerpc yet. If you'd like to help, I'd be delighted. > > I was going to say that it doesn't look too difficult, but then I > noticed we have a problem. PowerPC uses r11 as the static chain, > a register that is allowed to be used by linkage stubs. Hum. At the moment, the static chain is not part of the ABI -- it's private to the translation unit. But as soon as we start using this for the Go closure, it does become part of the ABI, so it would be best if we can choose a different register. That said, this *may* not actually be a problem. It's not the direct (possibly lazy bound) call into libffi that needs a static chain, it's the indirect call that libffi produces. And the indirect calls that Go produces. I'm pretty sure that there are no dynamically linked Go calls that require the static chain. They're used for closures, which are either fully indirect from a different translation unit, or locally bound closures through which the optimizer has seen the construction, and optimized to a direct call. Ian, have I missed a case where a closure could wind up with a direct call to a lazy bound function? r~