From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3376 invoked by alias); 18 Dec 2018 00:12:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 1276 invoked by uid 89); 18 Dec 2018 00:12:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=fence, H*f:sk:CE69209, H*f:sk:5492576, H*f:sk:B9184F5 X-HELO: arjuna.pair.com Received: from arjuna.pair.com (HELO arjuna.pair.com) (209.68.5.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 00:12:04 +0000 Received: by arjuna.pair.com (Postfix, from userid 3006) id 6ABF68A548; Mon, 17 Dec 2018 19:12:02 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id 69D348A556; Mon, 17 Dec 2018 19:12:02 -0500 (EST) Date: Tue, 18 Dec 2018 00:12:00 -0000 From: Hans-Peter Nilsson To: Wilco Dijkstra cc: "Uecker, Martin" , "hainque@adacore.com" , Richard Earnshaw , "gcc-patches@gcc.gnu.org" , Kyrylo Tkachov , James Greenhalgh , nd Subject: Re: [ping] Change static chain to r11 on aarch64 In-Reply-To: Message-ID: References: <54925765-e00a-e2b5-ec47-267659c8039d@arm.com> , ,<1544645040.23889.4.camel@med.uni-goettingen.de> , User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01272.txt.bz2 On Mon, 17 Dec 2018, Wilco Dijkstra wrote: > H-P: > > 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: > http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf > 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. :) brgds, H-P