From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8859 invoked by alias); 16 Oct 2015 14:36:59 -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 8846 invoked by uid 89); 16 Oct 2015 14:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Oct 2015 14:36:56 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-30-buA2Gp7SQ1-CZGZpISHpkw-1; Fri, 16 Oct 2015 15:36:51 +0100 Received: from [10.2.206.22] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2015 15:36:50 +0100 Message-ID: <56210B82.5060808@arm.com> Date: Fri, 16 Oct 2015 14:44:00 -0000 From: Jiong Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , James Greenhalgh Subject: [AArch64] Update comments on the usage of X30 in FIXED_REGISTERS and CALL_USED_REGISTERS X-MC-Unique: buA2Gp7SQ1-CZGZpISHpkw-1 Content-Type: multipart/mixed; boundary="------------060901060108020401010905" X-SW-Source: 2015-10/txt/msg01610.txt.bz2 This is a multi-part message in MIME format. --------------060901060108020401010905 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 417 The patch https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02654.html from last year changed the definition of LR in CALL_USED_REGISTERS, but didn't update the comment above the #define to reflect the new usage. This patch bring the comment inline with the implementation. OK for trunk? Thanks. 2015-10-16 Jiong. Wang gcc/ * config/aarch64/aarch64.h: Update the comments on usage of X30. --------------060901060108020401010905 Content-Type: text/x-diff; name=fix-comment.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fix-comment.patch" Content-length: 1511 diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 5a8db76..1eaaca0 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -210,14 +210,17 @@ extern unsigned aarch64_architecture_version; significant bits. Unlike AArch32 S1 is not packed into D0, etc. */ =20 -/* Note that we don't mark X30 as a call-clobbered register. The idea is - that it's really the call instructions themselves which clobber X30. - We don't care what the called function does with it afterwards. - - This approach makes it easier to implement sibcalls. Unlike normal - calls, sibcalls don't clobber X30, so the register reaches the - called function intact. EPILOGUE_USES says that X30 is useful - to the called function. */ +/* We don't mark X30 as a fixed register while we mark it as a caller-saved + register. The idea is we want X30 to be allocable as a caller-saved + register when possible. + + NOTE: although X30 is marked as caller-saved, it's callee-saved at the = same + time. The caller-saved attribute makes sure if X30 is allocated as free + register to hold any temporary value then the value is saved properly a= cross + function call. While on AArch64, the call instruction writes the return + address to LR. If the called function is a non-leaf function, it is the + responsibility of the callee to save and restore LR appropriately in it= 's + prologue / epilogue. */ =20 #define FIXED_REGISTERS \ { \ --------------060901060108020401010905--