This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Prohibiting use of some registers in the GCC compiler
- From: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- To: Nisal Menuka <nisalmenuka23 at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Wed, 31 May 2017 14:37:30 +0100
- Subject: Re: Prohibiting use of some registers in the GCC compiler
- Authentication-results: sourceware.org; auth=none
- References: <CAMryFvSatPP-ymvQBfz5-x78sQx4Yn-_wDExhVx_1_=3wqA=zA@mail.gmail.com>
On 31/05/17 00:34, Nisal Menuka wrote:
> Hi,
> I would like to reserve some registers in ARM64 processor and prohibit
> the compiler from using them in any scenario.
>
> For example: ARM64 Thirty-one 64-bit general-purpose registers X0-X30.
> I want to reserve register X30, and make sure when I compile any code
> using gcc, it won't use register X30 in any situation.
>
You can't reserve x30, it's the link register and clobbered by call
instructions.
R.
> How can this be done? Any help would be greatly appreciated.
>
> Thanks,
> Nisal
>