public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Andrew Haley <aph@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: libgcc: strange optimization
Date: Thu, 04 Aug 2011 11:20:00 -0000	[thread overview]
Message-ID: <CAFiYyc3DnnEdaaij0HQyyR00pCcpKh+2Z7-fT8aFHEdVzrFu=g@mail.gmail.com> (raw)
In-Reply-To: <4E3A7E40.1020906@redhat.com>

On Thu, Aug 4, 2011 at 1:10 PM, Andrew Haley <aph@redhat.com> wrote:
> On 08/04/2011 10:52 AM, Richard Guenther wrote:
>> On Thu, Aug 4, 2011 at 11:50 AM, Andrew Haley <aph@redhat.com> 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?  Or 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.  gcc 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.  I 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.  But 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.
>

  reply	other threads:[~2011-08-04 11:20 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 20:30 Michael Walle
2011-08-01 20:51 ` Georg-Johann Lay
2011-08-01 21:14   ` Michael Walle
2011-08-02  6:47     ` Georg-Johann Lay
2011-08-02  6:29   ` Hans-Peter Nilsson
2011-08-01 21:30 ` Richard Henderson
2011-08-02  6:37   ` Hans-Peter Nilsson
2011-08-02  8:49     ` Mikael Pettersson
2011-08-02  9:47       ` Richard Guenther
2011-08-02 10:02         ` Georg-Johann Lay
2011-08-02 10:11           ` Richard Guenther
2011-08-02 10:55             ` Michael Walle
2011-08-02 12:06               ` Mikael Pettersson
2011-08-02 12:23                 ` Richard Guenther
2011-08-02 12:36                   ` Georg-Johann Lay
2011-08-02 12:54                   ` Hans-Peter Nilsson
2011-08-02 13:09                     ` Richard Guenther
2011-08-02 13:16                       ` Hans-Peter Nilsson
2011-08-03  4:59                       ` Miles Bader
2011-08-02 13:23                   ` Ian Lance Taylor
2011-08-02 13:42                     ` Richard Guenther
2011-08-02 14:35                       ` Ian Lance Taylor
2011-08-03  9:12                       ` Ulrich Weigand
2011-08-03  9:51                         ` Georg-Johann Lay
2011-08-03 10:04                           ` Richard Guenther
2011-08-03 13:27                             ` Michael Matz
2011-08-03 14:02                               ` Richard Guenther
2011-08-03 14:55                                 ` Georg-Johann Lay
2011-08-03 15:05                                 ` Richard Henderson
2011-08-04  0:20                         ` Hans-Peter Nilsson
2011-08-04  7:29                           ` Andreas Schwab
2011-08-04 13:04                             ` Hans-Peter Nilsson
2011-08-04  9:51                           ` Andrew Haley
2011-08-04  9:52                             ` Richard Guenther
2011-08-04 11:11                               ` Andrew Haley
2011-08-04 11:20                                 ` Richard Guenther [this message]
2011-08-04 14:46                                   ` Andrew Haley
2011-08-06 15:00                                 ` Paolo Bonzini
2011-08-08  8:06                                   ` Richard Guenther
2011-08-08 10:59                                     ` Paolo Bonzini
2011-08-02 16:03                   ` Richard Henderson
2011-08-02 20:10                     ` Richard Guenther
2011-08-02 17:21                   ` Georg-Johann Lay
2011-08-09 16:55                   ` Richard Earnshaw
2011-08-09 17:24                     ` Ulrich Weigand
2011-08-09 19:48                       ` Hans-Peter Nilsson
2011-08-10  0:40                     ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc3DnnEdaaij0HQyyR00pCcpKh+2Z7-fT8aFHEdVzrFu=g@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=aph@redhat.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).