From patchwork Mon Nov 1 08:13:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Li X-Patchwork-Id: 46887 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CE443858426 for ; Mon, 1 Nov 2021 08:14:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CE443858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635754471; bh=xWdeQOO0sqc/OY+JDVRdaEK2vROo0vMdEUuytkvGIpY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=hOglS3ulb+Ew48Nkp39qmoXnxNlvR5Fpr59EezrW25C/X8193AOxB5Tl/QoHujWCg 28937iBBwFzb+9qilAGTkmcEktkoWTrnGqB0/i4MadZbR7ElSfXIFtR26ZB6+tMXZ7 nelbkQLZoC9B/D156He2MOpp9129hMYq1AEtV6Gk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by sourceware.org (Postfix) with ESMTPS id 11A853858422 for ; Mon, 1 Nov 2021 08:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 11A853858422 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R831e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04357; MF=ashimida@linux.alibaba.com; NM=1; PH=DS; RN=2; SR=0; TI=SMTPD_---0UuWIgGr_1635754431; Received: from localhost(mailfrom:ashimida@linux.alibaba.com fp:SMTPD_---0UuWIgGr_1635754431) by smtp.aliyun-inc.com(127.0.0.1); Mon, 01 Nov 2021 16:13:59 +0800 To: gcc-patches@gcc.gnu.org Subject: [PATCH] [PATCH] aarch64:fix redundant check in aut insn generation [PR103017] During the generation of the epilogue of aarch64(aarch64_expand_epilogue), the value of crtl->calls_eh_return does not need to be checked again. This value has been checked during aarch64_return_address_signing_enabled. Date: Mon, 1 Nov 2021 01:13:50 -0700 Message-Id: <20211101081350.35426-1-ashimida@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-21.6 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dan Li via Gcc-patches From: Dan Li Reply-To: Dan Li Cc: Dan Li Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_expand_epilogue): * config/aarch64/aarch64.md: Signed-off-by: Dan Li --- gcc/config/aarch64/aarch64.c | 6 +----- gcc/config/aarch64/aarch64.md | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 699c105a42a..8448e56443c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -9076,13 +9076,9 @@ aarch64_expand_epilogue (bool for_sibcall) 2) The RETAA instruction is not available before ARMv8.3-A, so if we are generating code for !TARGET_ARMV8_3 we can't use it and must explicitly authenticate. - - 3) On an eh_return path we make extra stack adjustments to update the - canonical frame address to be the exception handler's CFA. We want - to authenticate using the CFA of the function which calls eh_return. */ if (aarch64_return_address_signing_enabled () - && (for_sibcall || !TARGET_ARMV8_3 || crtl->calls_eh_return)) + && (for_sibcall || !TARGET_ARMV8_3)) { switch (aarch64_ra_sign_key) { diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 1a39470a1fe..65ee6159d73 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -879,8 +879,7 @@ (define_insn "*do_return" { const char *ret = NULL; if (aarch64_return_address_signing_enabled () - && (TARGET_PAUTH) - && !crtl->calls_eh_return) + && (TARGET_PAUTH)) { if (aarch64_ra_sign_key == AARCH64_KEY_B) ret = "retab";