From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13848 invoked by alias); 4 Aug 2011 11:20:17 -0000 Received: (qmail 13837 invoked by uid 22791); 4 Aug 2011 11:20:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 11:19:54 +0000 Received: by ywe9 with SMTP id 9so1098865ywe.20 for ; Thu, 04 Aug 2011 04:19:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.92.20 with SMTP id u20mr1743477ybl.421.1312456793654; Thu, 04 Aug 2011 04:19:53 -0700 (PDT) Received: by 10.150.219.17 with HTTP; Thu, 4 Aug 2011 04:19:53 -0700 (PDT) In-Reply-To: <4E3A7E40.1020906@redhat.com> References: <201108030911.p739BZri018360@d06av02.portsmouth.uk.ibm.com> <4E3A6B73.7030903@redhat.com> <4E3A7E40.1020906@redhat.com> Date: Thu, 04 Aug 2011 11:20:00 -0000 Message-ID: Subject: Re: libgcc: strange optimization From: Richard Guenther To: Andrew Haley Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00090.txt.bz2 On Thu, Aug 4, 2011 at 1:10 PM, Andrew Haley wrote: > On 08/04/2011 10:52 AM, Richard Guenther wrote: >> On Thu, Aug 4, 2011 at 11:50 AM, Andrew Haley wrote: >>> On 08/04/2011 01:19 AM, Hans-Peter Nilsson wrote: >>> >>>> To make sure, it'd be nice if someone could perhaps grep an >>>> entire GNU/Linux-or-other distribution including the kernel for >>>> uses of asm-declared *local* registers that don't directly feed >>>> into asms and not being the stack-pointer? =A0Or can we get away >>>> with just saying that local asm registers haven't had any other >>>> documented meaning for the last seven years? >>> >>> It's the sort of thing that gets done in threaded interpreters, >>> where you really need to keep a few pointers in registers and >>> the interpreter itself is a very long function. =A0gcc has always >>> done a dreadful job of register allocation in such cases. >> >> Sure, but what I have seen people use global register variables >> for this (which means they get taken away from the register allocator). > > Not always though, and the x86 has so few registers that using a > global register variable is very problematic. =A0I suppose you could > compile the threaded interpreter in a file of its own, but I'm not > sure that has quite the same semantics as local register variables. > > The problem is that people who care about this stuff very much don't > always read gcc@gcc.gnu.org so won't be heard. =A0But in their own world > (LISP, Forth) nice features like register variables and labels as > values have led to gcc being the preferred compiler for this kind of > work. Well, the uses won't break with the idea - they would simply work like if they were not using local register variables. Richard. > Andrew. >