Register Usage

Ian Lance Taylor
Wed Apr 29 00:27:00 GMT 2009

John Farmer <> writes:

> 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.
> 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.

When gcc needs a frame pointer in Thumb code, it will always use r7.
There is no way to change this.  I'm not sure why you would want to
change it.


More information about the Gcc-help mailing list