From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16053 invoked by alias); 29 Apr 2009 09:27:55 -0000 Received: (qmail 16045 invoked by uid 22791); 29 Apr 2009 09:27:54 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Apr 2009 09:27:48 +0000 Received: from cam-owa2.Emea.Arm.com (cam-owa2.emea.arm.com [10.1.105.18]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id n3T9NoZm017082; Wed, 29 Apr 2009 10:23:50 +0100 (BST) Received: from [10.1.129.13] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Apr 2009 10:27:44 +0100 Subject: Re: Register Usage From: Richard Earnshaw To: John Farmer Cc: gcc-help@gcc.gnu.org In-Reply-To: <23287035.post@talk.nabble.com> References: <23279910.post@talk.nabble.com> <23287035.post@talk.nabble.com> Content-Type: text/plain Date: Wed, 29 Apr 2009 09:27:00 -0000 Message-Id: <1240997259.21004.8.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-04/txt/msg00433.txt.bz2 On Tue, 2009-04-28 at 15:06 -0700, John Farmer wrote: > Hi Ian thanks for the reply, > > I had a good look through the ARM-THUMB Procedure Call Standard and it sort > of suggests that R7 could be used as a frame pointer. Looked through the GCC > docs and found the -fabi option but it appears to apply to C++ code. > The ARM-THUMB Procedure Call standard was superseded by "The ABI for the ARM Architecture" nearly 5 years ago now, you can obtain the most recent documents from the ARM documentation website: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html The current PCS is supported in gcc by several configurations (most of which have 'eabi' somewhere in the configuration name; for Cortex-m3 I strongly recommend you use one of those configurations. You might also want to configure the compiler with "--with-isa=thumb" and "--with-cpu=cortex-m3"; this will save you from having to modify your configure scripts or compiler command lines every time you build some code. > I am still wondering what makes the decision to use R7 as the frame pointer. > If its used because of an ABI standard for the ARM Cortex-M3 CPU how is it > specified to GCC? Also if this is the case is there a standard that I could > look through? I have looked on the ARM web site but not found it yet. The procedure call standards do not specify a frame pointer any more (and haven't for nearly 15 years -- ie since Thumb was added to the architecture). So any compiler using a frame pointer is free to use whatever register is wishes to. In thumb you want to avoid using a frame pointer whenever possible since non-stack based addressing is severely limited in the offsets that are permitted. R.