ARM: use of r10 register

Richard Earnshaw rearnsha@arm.com
Wed Nov 18 03:06:00 GMT 1998


> Hi!
> 
> I noticed in config/arm.h that it says:
> 
> /* Register allocation in ARM Procedure Call Standard (as used on
> RISCiX):
>    (S - saved over call).
> 
> ......
>         r10        F S  (sl) stack limit (not currently used)
> 
....
> As far as I can tell, this means that r10 won't be used. looking in the
> assembler generated, r10 does not seem to be used, but I haven't asked
> for stack limit checking. What am I missing? How do I get r10 to be
> used?

R10 isn't used more for historical reasons than anything else.  The ARM 
port was originally done for Acorn's RISCiX platform, which reserved r10 
for itself (it quietly clobbered in in the C library).  On other platforms 
this does not apply, and a future release of the compiler may start to use 
it as a call-saved register.

You can turn it on yourself by adding -fcall-saved-r10 to the compilation 
options.

Richard

Beware: PIC compilation will normally try to use r10 as the pic register 
if it isn't being used for the stack limit register.

R.




More information about the Gcc-bugs mailing list