[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0)
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] Re: [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0) |
Date: |
Fri, 9 Apr 2010 00:44:03 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.33-2-amd64; KDE/4.3.4; x86_64; ; ) |
> 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