From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] Re: [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0)
Date: Fri, 9 Apr 2010 00:44:03 +0100 [thread overview]
Message-ID: <201004090044.04139.paul@codesourcery.com> (raw)
In-Reply-To: <20100408224405.GB2220@volta.aurel32.net>
> On Thu, Apr 08, 2010 at 03:38:52PM +0200, Stefan Weil wrote:
> > Register fp is a bad choice for compilations without
> > optimisation, because the compiler makes heavy use
> > of this register (so the resulting code crashes).
>
> I don't fully understand why the compiler makes use of this register in
> code where env is declared as register fp.
The frame pointer (and certain other registers, typically stack pointer, link
register, PIC base, TLS base, etc.) are special. They have predefined uses,
usually specified by the relevant platform ABI.
Defining a global register variable (or using -ffixed-reg) only excludes these
registers from general register allocation. It does not prevent them being
used for specific purposes. The user is responsible for ensuring that any
assumptions/requirements made by the ABI are still met.
In some cases gcc can diagnose invalid uses. In others the overlap may be
legitimate, but not necessarily what we intended in qemu.
Paul
next prev parent reply other threads:[~2010-04-08 23:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 13:38 [Qemu-devel] [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0) Stefan Weil
2010-04-08 22:44 ` [Qemu-devel] " Aurelien Jarno
2010-04-08 23:44 ` Paul Brook [this message]
2010-04-09 6:42 ` Stefan Weil
2010-04-09 7:36 ` [Qemu-devel] " Stefan Weil
2010-04-09 14:45 ` Richard Henderson
2010-04-09 15:28 ` Stefan Weil
2010-04-09 15:57 ` [Qemu-devel] " Aurelien Jarno
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=201004090044.04139.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).