This is the mail archive of the
mailing list for the GCC project.
Re: [ping] Change static chain to r11 on aarch64
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: "Uecker, Martin" <Martin dot Uecker at med dot uni-goettingen dot de>, "hainque at adacore dot com" <hainque at adacore dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>, James Greenhalgh <James dot Greenhalgh at arm dot com>, nd <nd at arm dot com>
- Date: Mon, 17 Dec 2018 19:12:02 -0500 (EST)
- Subject: Re: [ping] Change static chain to r11 on aarch64
- References: <CE69209B-F89F-4F7D-95DD-18867F153CFF@adacore.com> <firstname.lastname@example.org> ,<B9184F5B-B6D7-4537-9695-C5191C794333@adacore.com> <DB5PR08MB103081A8877309883FE3830C83A70@DB5PR08MB1030.eurprd08.prod.outlook.com>,<email@example.com> <DB5PR08MB1030F6E82F66E0292C2D630D83A70@DB5PR08MB1030.eurprd08.prod.outlook.com>,<alpine.BSF.firstname.lastname@example.org> <DB5PR08MB1030E68EF35E7BB54ADCF1ED83BC0@DB5PR08MB1030.eurprd08.prod.outlook.com>
On Mon, 17 Dec 2018, Wilco Dijkstra wrote:
> > So, changing from R18 to R11 for aarch64 seems right, as the
> > latter is call-clobbered and the former is call-saved IIUC.
> The AArch64 ABI defines x18 as platform specific:
> On Linux it is call-clobbered, but it could be a fixed register on other
> platforms (eg. a thread-local pointer). I don't think it's possible to make
> it a callee-save.
JFTR, in gcc, it's treated as call-saved, AFAICS, with no
special-casing (other than being STATIC_CHAIN_REGNUM, which
by itself has no other effect).
Is that a bug or deliberate? If deliberate, a comment at
CALL_USED_REGISTERS would have cleared that question.
The document you refer to seems to be on the fence regarding
whether a compiler should treat it as call-clobbered.
> Still it is the wrong register to use since it already has
> different uses. Using x9 would make its use as an extra argument clearer.
Sure. For one, it would avoid the bug with
STATIC_CHAIN_REGNUM being call-saved. :)