From d106029c2aaf18f25bacf0d6faf9934d858ec8e6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 14 Sep 2020 10:53:50 +0200 Subject: [PATCH] arm: Fix up gcc.target/arm/lto/pr96939_* FAIL The following patch on top of the https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553801.html patch fixes the gcc.target/arm/lto/pr96939_* test in certain ARM configurations. As said in the above mentioned patch, the generic code takes care of saving/restoring TargetVariables or Target Save options, so this just arranges for the generic code to save those instead of needing the arm backend to do it manually. 2020-09-14 Jakub Jelinek * config/arm/arm.opt (x_arm_arch_string, x_arm_cpu_string, x_arm_tune_string): Remove TargetSave entries. (march=, mcpu=, mtune=): Add Save keyword. * config/arm/arm.c (arm_option_save): Remove. (TARGET_OPTION_SAVE): Don't redefine. (arm_option_restore): Don't restore x_arm_*_string here. --- gcc/config/arm/arm.c | 18 ------------------ gcc/config/arm/arm.opt | 15 +++------------ 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f4f32b66a3b..e37cd6f8fe6 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -247,8 +247,6 @@ static tree arm_build_builtin_va_list (void); static void arm_expand_builtin_va_start (tree, rtx); static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); static void arm_option_override (void); -static void arm_option_save (struct cl_target_option *, struct gcc_options *, - struct gcc_options *); static void arm_option_restore (struct gcc_options *, struct gcc_options *, struct cl_target_option *); static void arm_override_options_after_change (void); @@ -443,9 +441,6 @@ static const struct attribute_spec arm_attribute_table[] = #undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE #define TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE arm_override_options_after_change -#undef TARGET_OPTION_SAVE -#define TARGET_OPTION_SAVE arm_option_save - #undef TARGET_OPTION_RESTORE #define TARGET_OPTION_RESTORE arm_option_restore @@ -3042,24 +3037,11 @@ arm_override_options_after_change (void) arm_override_options_after_change_1 (&global_options, &global_options_set); } -/* Implement TARGET_OPTION_SAVE. */ -static void -arm_option_save (struct cl_target_option *ptr, struct gcc_options *opts, - struct gcc_options */* opts_set */) -{ - ptr->x_arm_arch_string = opts->x_arm_arch_string; - ptr->x_arm_cpu_string = opts->x_arm_cpu_string; - ptr->x_arm_tune_string = opts->x_arm_tune_string; -} - /* Implement TARGET_OPTION_RESTORE. */ static void arm_option_restore (struct gcc_options *opts, struct gcc_options *opts_set, struct cl_target_option *ptr) { - opts->x_arm_arch_string = ptr->x_arm_arch_string; - opts->x_arm_cpu_string = ptr->x_arm_cpu_string; - opts->x_arm_tune_string = ptr->x_arm_tune_string; arm_configure_build_target (&arm_active_target, ptr, opts_set, false); } diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index cd3d8e1beac..f01cd65eb33 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -21,15 +21,6 @@ HeaderInclude config/arm/arm-opts.h -TargetSave -const char *x_arm_arch_string - -TargetSave -const char *x_arm_cpu_string - -TargetSave -const char *x_arm_tune_string - Enum Name(tls_type) Type(enum arm_tls_type) TLS dialect to use: @@ -82,7 +73,7 @@ mapcs-stack-check Target Report Mask(APCS_STACK) Undocumented march= -Target RejectNegative Negative(march=) ToLower Joined Var(arm_arch_string) +Target Save RejectNegative Negative(march=) ToLower Joined Var(arm_arch_string) Specify the name of the target architecture. ; Other arm_arch values are loaded from arm-tables.opt @@ -107,7 +98,7 @@ Target Report Mask(CALLER_INTERWORKING) Thumb: Assume function pointers may go to non-Thumb aware code. mcpu= -Target RejectNegative Negative(mcpu=) ToLower Joined Var(arm_cpu_string) +Target Save RejectNegative Negative(mcpu=) ToLower Joined Var(arm_cpu_string) Specify the name of the target CPU. mfloat-abi= @@ -232,7 +223,7 @@ Target Report Mask(TPCS_LEAF_FRAME) Thumb: Generate (leaf) stack frames even if not needed. mtune= -Target RejectNegative Negative(mtune=) ToLower Joined Var(arm_tune_string) +Target Save RejectNegative Negative(mtune=) ToLower Joined Var(arm_tune_string) Tune code for the given processor. mprint-tune-info -- 2.30.2