From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 58F3E3858CD1 for ; Sun, 26 Nov 2023 14:50:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58F3E3858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 58F3E3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701010253; cv=none; b=CBCrZhfFlPPnnOO23EuDYL8CKFVVt23fZd6sq4dvdsDdCFdyw8rbLEyBHVTo0MBG5ikHf4gtQXYjEbqZ49fOzlnys9LRnBBbSLGovdGciJ1c0d2s32C7H4zFKPlOFnZUuZ12q035jGmCuvkOTfwFMEU9LOuSDoIxwdg3fSiQCuk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701010253; c=relaxed/simple; bh=ldjTQ/uiRFGesnSLDI2LcxFsXlvzr+1g6Egqgii9jy4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=tyixS6S0T+7s4ROF7QhM6BktloGXIqmbt9MRuS+k3b0hM6A++YWnsEAzIhbPj+hY7XgN81l+gZ47/XDZnZbzwW2nT83r5UfjFKTJoj/9L/BbagjbTXE332anBLhC5RFezf+LJEtpoclGp8DXcrSPejjtJsYFkNrRPjfJ3TSKbKE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A326DA7; Sun, 26 Nov 2023 06:51:39 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 970673F5A1; Sun, 26 Nov 2023 06:50:51 -0800 (PST) From: Richard Sandiford To: Szabolcs Nagy Mail-Followup-To: Szabolcs Nagy ,, richard.sandiford@arm.com Cc: Subject: Re: [PATCH v2 5/7] aarch64,arm: Remove accepted_branch_protection_string References: <8ebe0679d0d92c8c39bffc98e1f30e2b29770e00.1699025214.git.szabolcs.nagy@arm.com> Date: Sun, 26 Nov 2023 14:50:50 +0000 In-Reply-To: <8ebe0679d0d92c8c39bffc98e1f30e2b29770e00.1699025214.git.szabolcs.nagy@arm.com> (Szabolcs Nagy's message of "Fri, 3 Nov 2023 15:36:32 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-22.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Szabolcs Nagy writes: > On aarch64 this caused ICE with pragma push_options since > > commit ae54c1b09963779c5c3914782324ff48af32e2f1 > Author: Wilco Dijkstra > CommitDate: 2022-06-01 18:13:57 +0100 > > AArch64: Cleanup option processing code > > The failure is at pop_options: > > internal compiler error: =E2=80=98global_options=E2=80=99 are modified in= local context > > On arm the variable was unused. > > gcc/ChangeLog: > > * config/aarch64/aarch64.cc (aarch64_override_options_after_change_1): > Do not override branch_protection options. > (aarch64_override_options): Remove accepted_branch_protection_string. > * config/arm/aarch-common.cc (BRANCH_PROTECT_STR_MAX): Remove. > (aarch_parse_branch_protection): Remove > accepted_branch_protection_string. > * config/arm/arm.cc: Likewise. OK. Not sure I fully understand the subtlety of how things worked before Wilco's patch, but I agree it looks like all the results of the parsing are correctly captured by Target options or TargetVariables in aarch64.opt, and so no special handling is needed. Thanks, Richard > --- > unchanged from v1 > --- > gcc/config/aarch64/aarch64.cc | 10 +--------- > gcc/config/arm/aarch-common.cc | 16 ---------------- > gcc/config/arm/arm.cc | 2 -- > 3 files changed, 1 insertion(+), 27 deletions(-) > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > index 88594bed8ce..f8e8fefc8d8 100644 > --- a/gcc/config/aarch64/aarch64.cc > +++ b/gcc/config/aarch64/aarch64.cc > @@ -323,8 +323,6 @@ bool aarch64_pcrelative_literal_loads; > /* Global flag for whether frame pointer is enabled. */ > bool aarch64_use_frame_pointer; >=20=20 > -char *accepted_branch_protection_string =3D NULL; > - > /* Support for command line parsing of boolean flags in the tuning > structures. */ > struct aarch64_flag_desc > @@ -18101,12 +18099,6 @@ aarch64_adjust_generic_arch_tuning (struct tune_= params ¤t_tune) > static void > aarch64_override_options_after_change_1 (struct gcc_options *opts) > { > - if (accepted_branch_protection_string) > - { > - opts->x_aarch64_branch_protection_string > - =3D xstrdup (accepted_branch_protection_string); > - } > - > /* PR 70044: We have to be careful about being called multiple times f= or the > same function. This means all changes should be repeatable. */ >=20=20 > @@ -18715,7 +18707,7 @@ aarch64_override_options (void) > /* Return address signing is currently not supported for ILP32 targets= . For > LP64 targets use the configured option in the absence of a command-= line > option for -mbranch-protection. */ > - if (!TARGET_ILP32 && accepted_branch_protection_string =3D=3D NULL) > + if (!TARGET_ILP32 && aarch64_branch_protection_string =3D=3D NULL) > { > #ifdef TARGET_ENABLE_PAC_RET > aarch_ra_sign_scope =3D AARCH_FUNCTION_NON_LEAF; > diff --git a/gcc/config/arm/aarch-common.cc b/gcc/config/arm/aarch-common= .cc > index 5b96ff4c2e8..cbc7f68a8bf 100644 > --- a/gcc/config/arm/aarch-common.cc > +++ b/gcc/config/arm/aarch-common.cc > @@ -659,9 +659,6 @@ arm_md_asm_adjust (vec &outputs, vec & /*in= puts*/, > return saw_asm_flag ? seq : NULL; > } >=20=20 > -#define BRANCH_PROTECT_STR_MAX 255 > -extern char *accepted_branch_protection_string; > - > static enum aarch_parse_opt_result > aarch_handle_no_branch_protection (char* str, char* rest) > { > @@ -812,19 +809,6 @@ aarch_parse_branch_protection (const char *const_str= , char** last_str) > else > *last_str =3D NULL; > } > - > - if (res =3D=3D AARCH_PARSE_OK) > - { > - /* If needed, alloc the accepted string then copy in const_str. > - Used by override_option_after_change_1. */ > - if (!accepted_branch_protection_string) > - accepted_branch_protection_string > - =3D (char *) xmalloc (BRANCH_PROTECT_STR_MAX + 1); > - strncpy (accepted_branch_protection_string, const_str, > - BRANCH_PROTECT_STR_MAX + 1); > - /* Forcibly null-terminate. */ > - accepted_branch_protection_string[BRANCH_PROTECT_STR_MAX] =3D '\0'; > - } > return res; > } >=20=20 > diff --git a/gcc/config/arm/arm.cc b/gcc/config/arm/arm.cc > index 6e933c80183..f49312cace0 100644 > --- a/gcc/config/arm/arm.cc > +++ b/gcc/config/arm/arm.cc > @@ -2424,8 +2424,6 @@ const struct tune_params arm_fa726te_tune =3D > tune_params::SCHED_AUTOPREF_OFF > }; >=20=20 > -char *accepted_branch_protection_string =3D NULL; > - > /* Auto-generated CPU, FPU and architecture tables. */ > #include "arm-cpu-data.h"