public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-9682] arm: Remove use of opts_set in arm_configure_build_target [PR100767] Date: Thu, 19 Aug 2021 16:44:38 +0000 (GMT) [thread overview] Message-ID: <20210819164438.593213891036@sourceware.org> (raw) https://gcc.gnu.org/g:255fe52e8ad859f59bb863ad75d00fa84caa88bd commit r9-9682-g255fe52e8ad859f59bb863ad75d00fa84caa88bd Author: Richard Earnshaw <rearnsha@arm.com> Date: Thu May 27 10:25:37 2021 +0100 arm: Remove use of opts_set in arm_configure_build_target [PR100767] The variable global_options_set is a reflection of which options have been explicitly set from the command line in the structure global_options. But it doesn't describe the contents of a cl_target_option. cl_target_option is a set of options to apply and once configured should represent a viable set of options without needing to know which were explicitly set by the user. Unfortunately arm_configure_build_target was incorrectly conflating the two. Fortunately, however, we do not really need to know this since the various override_options functions should have sanitized the target_options values before constructing a cl_target_option structure. It is safe, therefore, to simply drop this parameter to arm_configure_build_target and rely on checking that various string parameters are non-null before dereferencing them. gcc: PR target/100767 * config/arm/arm.c (arm_configure_build_target): Remove parameter opts_set, directly check opts parameters for being non-null. (arm_option_restore): Update call to arm_configure_build_target. (arm_option_override): Likewise. (arm_can_inline_p): Likewise. (arm_valid_target_attribute_tree): Likewise. * config/arm/arm-c.c (arm_pragma_target_parse): Likewise. * config/arm/arm-protos.h (arm_configure_build_target): Adjust prototype. (cherry picked from commit 262e75d22c350acbdf4c1fb4f224cc5d3d711eff) Diff: --- gcc/config/arm/arm-c.c | 3 +-- gcc/config/arm/arm-protos.h | 3 +-- gcc/config/arm/arm.c | 23 +++++++++-------------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 6e256ee0a12..38da34203d0 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -266,8 +266,7 @@ arm_pragma_target_parse (tree args, tree pop_target) target_option_current_node, but not handle_pragma_target. */ target_option_current_node = cur_tree; arm_configure_build_target (&arm_active_target, - TREE_TARGET_OPTION (cur_tree), - &global_options_set, false); + TREE_TARGET_OPTION (cur_tree), false); } /* Update macros if target_node changes. The global state will be restored diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 3e8bba5caea..cd16c3c35f9 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -229,8 +229,7 @@ extern bool arm_change_mode_p (tree); extern tree arm_valid_target_attribute_tree (tree, struct gcc_options *, struct gcc_options *); extern void arm_configure_build_target (struct arm_build_target *, - struct cl_target_option *, - struct gcc_options *, bool); + struct cl_target_option *, bool); extern void arm_option_reconfigure_globals (void); extern void arm_options_perform_arch_sanity_checks (void); extern void arm_pr_long_calls (struct cpp_reader *); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 4679da75dd8..3895007dcdb 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2985,7 +2985,7 @@ arm_override_options_after_change (void) { arm_configure_build_target (&arm_active_target, TREE_TARGET_OPTION (target_option_default_node), - &global_options_set, false); + false); arm_override_options_after_change_1 (&global_options); } @@ -3006,8 +3006,7 @@ arm_option_restore (struct gcc_options *opts, 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, &global_options_set, - false); + arm_configure_build_target (&arm_active_target, ptr, false); } /* Reset options between modes that the user has specified. */ @@ -3124,7 +3123,6 @@ static sbitmap isa_quirkbits; void arm_configure_build_target (struct arm_build_target *target, struct cl_target_option *opts, - struct gcc_options *opts_set, bool warn_compatible) { const cpu_option *arm_selected_tune = NULL; @@ -3139,7 +3137,7 @@ arm_configure_build_target (struct arm_build_target *target, target->core_name = NULL; target->arch_name = NULL; - if (opts_set->x_arm_arch_string) + if (opts->x_arm_arch_string) { arm_selected_arch = arm_parse_arch_option_name (all_architectures, "-march", @@ -3147,7 +3145,7 @@ arm_configure_build_target (struct arm_build_target *target, arch_opts = strchr (opts->x_arm_arch_string, '+'); } - if (opts_set->x_arm_cpu_string) + if (opts->x_arm_cpu_string) { arm_selected_cpu = arm_parse_cpu_option_name (all_cores, "-mcpu", opts->x_arm_cpu_string); @@ -3157,7 +3155,7 @@ arm_configure_build_target (struct arm_build_target *target, options for tuning. */ } - if (opts_set->x_arm_tune_string) + if (opts->x_arm_tune_string) { arm_selected_tune = arm_parse_cpu_option_name (all_cores, "-mtune", opts->x_arm_tune_string); @@ -3392,8 +3390,7 @@ arm_option_override (void) } cl_target_option_save (&opts, &global_options); - arm_configure_build_target (&arm_active_target, &opts, &global_options_set, - true); + arm_configure_build_target (&arm_active_target, &opts, true); #ifdef SUBTARGET_OVERRIDE_OPTIONS SUBTARGET_OVERRIDE_OPTIONS; @@ -30938,10 +30935,8 @@ arm_can_inline_p (tree caller, tree callee) caller_target.isa = sbitmap_alloc (isa_num_bits); callee_target.isa = sbitmap_alloc (isa_num_bits); - arm_configure_build_target (&caller_target, caller_opts, &global_options_set, - false); - arm_configure_build_target (&callee_target, callee_opts, &global_options_set, - false); + arm_configure_build_target (&caller_target, caller_opts, false); + arm_configure_build_target (&callee_target, callee_opts, false); if (!bitmap_subset_p (callee_target.isa, caller_target.isa)) can_inline = false; @@ -31073,7 +31068,7 @@ arm_valid_target_attribute_tree (tree args, struct gcc_options *opts, return NULL_TREE; cl_target_option_save (&cl_opts, opts); - arm_configure_build_target (&arm_active_target, &cl_opts, opts_set, false); + arm_configure_build_target (&arm_active_target, &cl_opts, false); arm_option_check_internal (opts); /* Do any overrides, such as global options arch=xxx. We do this since arm_active_target was overridden. */
reply other threads:[~2021-08-19 16:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210819164438.593213891036@sourceware.org \ --to=rearnsha@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).