From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O01OQ-0002mv-K3 for qemu-devel@nongnu.org; Thu, 08 Apr 2010 19:44:14 -0400 Received: from [140.186.70.92] (port=58925 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O01OP-0002mm-F1 for qemu-devel@nongnu.org; Thu, 08 Apr 2010 19:44:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O01ON-0002VW-OQ for qemu-devel@nongnu.org; Thu, 08 Apr 2010 19:44:13 -0400 Received: from mx20.gnu.org ([199.232.41.8]:34239) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O01ON-0002VS-LG for qemu-devel@nongnu.org; Thu, 08 Apr 2010 19:44:11 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O01ON-0002aG-1U for qemu-devel@nongnu.org; Thu, 08 Apr 2010 19:44:11 -0400 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 References: <1270733932-7906-1-git-send-email-weil@mail.berlios.de> <20100408224405.GB2220@volta.aurel32.net> In-Reply-To: <20100408224405.GB2220@volta.aurel32.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201004090044.04139.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Aurelien Jarno > 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