From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2092) id ACF0D3858407; Fri, 10 Mar 2023 16:21:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACF0D3858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678465298; bh=yvQ3CBzkdhdORD8fMTi5okQiDR3ICT/dIjsbJJV+psI=; h=From:To:Subject:Date:From; b=xlletx0q0sB/JAjr10qNv0ag9LzMIMtGBlyx9L3Xsc8FfeIS0FU7y9e7Ca0pU2neQ 2ZwaObjh9XIhLv8kPHRN9/I4Ba3FDD0UzFtmw4ZAGQKcVckZoa8kSyXhWGKp7D6cHD A3TM2Nvs5gH3RPBZvpBSGIJ9pSFko0mWpf+LNSi8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andrea Corallo To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-12-m-pacbti)] aarch64: Fix return_address_sign_ab_exception.C regression X-Act-Checkin: gcc X-Git-Author: Andrea Corallo X-Git-Refname: refs/vendors/ARM/heads/arm-12-m-pacbti X-Git-Oldrev: a93bf01521c09d99a21086ece64e74345069fa03 X-Git-Newrev: 9d560b2365c8aee249a0ad17ba0af0c5a157d20a Message-Id: <20230310162138.ACF0D3858407@sourceware.org> Date: Fri, 10 Mar 2023 16:21:38 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9d560b2365c8aee249a0ad17ba0af0c5a157d20a commit 9d560b2365c8aee249a0ad17ba0af0c5a157d20a Author: Andrea Corallo Date: Thu Feb 2 17:25:05 2023 +0100 aarch64: Fix return_address_sign_ab_exception.C regression Hi all, this is to fix the regression of g++.target/aarch64/return_address_sign_ab_exception.C that I introduced with d8dadbc9a5199bf7bac1ab7376b0f84f45e94350. 'aarch_ra_sign_key' for aarch64 ended up being non defined in the opt file and the function attribute "branch-protection=pac-ret+leaf+b-key" stopped working as expected. This patch moves the definition of 'aarch_ra_sign_key' to the opt files for both Arm back-ends. Regards Andera Corallo gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch_ra_sign_key): Remove declaration. * config/aarch64/aarch64.cc (aarch_ra_sign_key): Remove definition. * config/aarch64/aarch64.opt (aarch64_ra_sign_key): Rename to 'aarch_ra_sign_key'. * config/arm/aarch-common.cc (aarch_ra_sign_key): Remove declaration. * config/arm/arm-protos.h (aarch_ra_sign_key): Likewise. * config/arm/arm.cc (enum aarch_key_type): Remove definition. * config/arm/arm.opt: Define. Diff: --- gcc/config/aarch64/aarch64-protos.h | 2 -- gcc/config/aarch64/aarch64.cc | 2 -- gcc/config/aarch64/aarch64.opt | 3 +++ gcc/config/arm/aarch-common.cc | 1 - gcc/config/arm/arm-protos.h | 1 - gcc/config/arm/arm.cc | 3 --- gcc/config/arm/arm.opt | 3 +++ 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 0fec704c137..3565886f583 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -661,8 +661,6 @@ enum simd_immediate_check { AARCH64_CHECK_MOV = AARCH64_CHECK_ORR | AARCH64_CHECK_BIC }; -extern enum aarch_key_type aarch_ra_sign_key; - extern struct tune_params aarch64_tune_params; /* The available SVE predicate patterns, known in the ACLE as "svpattern". */ diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 25eb48022eb..1aa562d1060 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -2745,8 +2745,6 @@ static const struct processor *selected_arch; static const struct processor *selected_cpu; static const struct processor *selected_tune; -enum aarch_key_type aarch_ra_sign_key = AARCH_KEY_A; - /* The current tuning set. */ struct tune_params aarch64_tune_params = generic_tunings; diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt index 61937fb92cf..3ec28767963 100644 --- a/gcc/config/aarch64/aarch64.opt +++ b/gcc/config/aarch64/aarch64.opt @@ -39,6 +39,9 @@ uint64_t aarch64_isa_flags = 0 TargetVariable unsigned aarch_enable_bti = 2 +TargetVariable +enum aarch_key_type aarch_ra_sign_key = AARCH_KEY_A + ; The TLS dialect names to use with -mtls-dialect. Enum diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common.cc index 6d254101f6a..010cfc8c5c5 100644 --- a/gcc/config/arm/aarch-common.cc +++ b/gcc/config/arm/aarch-common.cc @@ -661,7 +661,6 @@ arm_md_asm_adjust (vec &outputs, vec & /*inputs*/, #define BRANCH_PROTECT_STR_MAX 255 extern char *accepted_branch_protection_string; -extern enum aarch_key_type aarch_ra_sign_key; static enum aarch_parse_opt_result aarch_handle_no_branch_protection (char* str, char* rest) diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index d43e42811cb..4ec47d24614 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -586,7 +586,6 @@ struct cpu_option extern const arch_option all_architectures[]; extern const cpu_option all_cores[]; -extern enum aarch_key_type aarch_ra_sign_key; const cpu_option *arm_parse_cpu_option_name (const cpu_option *, const char *, const char *, bool = true); diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc index be2893ea6ff..5fcf8a10ba8 100644 --- a/gcc/config/arm/arm.cc +++ b/gcc/config/arm/arm.cc @@ -2424,9 +2424,6 @@ const struct tune_params arm_fa726te_tune = tune_params::SCHED_AUTOPREF_OFF }; -/* Key type for Pointer Authentication extension. */ -enum aarch_key_type aarch_ra_sign_key = AARCH_KEY_A; - char *accepted_branch_protection_string = NULL; /* Auto-generated CPU, FPU and architecture tables. */ diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 6b34725b6ea..970f1e9e8e2 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -30,6 +30,9 @@ enum aarch_function_type aarch_ra_sign_scope = AARCH_FUNCTION_NONE TargetVariable unsigned aarch_enable_bti = 0 +TargetVariable +enum aarch_key_type aarch_ra_sign_key = AARCH_KEY_A + Enum Name(tls_type) Type(enum arm_tls_type) TLS dialect to use: