Blame SOURCES/gcc10-pr96939-3.patch

52d91f
2020-09-13  Jakub Jelinek  <jakub@redhat.com>
52d91f
52d91f
	* config/arm/arm.opt (arm_arch_specified, arm_cpu_specified,
52d91f
	arm_tune_specified): New TargetVariables.
52d91f
	* config/arm/arm.c (arm_configure_build_target): Comment out
52d91f
	opts_set argument name.  Use opts->x_arm_*_specified instead
52d91f
	of opts_set->x_arm_*_string.
52d91f
	* common/config/arm/arm-common.c (arm_handle_option): New function.
52d91f
	(TARGET_HANDLE_OPTION): Redefine.
52d91f
52d91f
--- gcc/config/arm/arm.opt.jj	2020-09-12 13:36:27.619716335 +0200
52d91f
+++ gcc/config/arm/arm.opt	2020-09-12 13:38:48.547661292 +0200
52d91f
@@ -30,6 +30,15 @@ const char *x_arm_cpu_string
52d91f
 TargetSave
52d91f
 const char *x_arm_tune_string
52d91f
 
52d91f
+TargetVariable
52d91f
+unsigned char arm_arch_specified = 0
52d91f
+
52d91f
+TargetVariable
52d91f
+unsigned char arm_cpu_specified = 0
52d91f
+
52d91f
+TargetVariable
52d91f
+unsigned char arm_tune_specified = 0
52d91f
+
52d91f
 Enum
52d91f
 Name(tls_type) Type(enum arm_tls_type)
52d91f
 TLS dialect to use:
52d91f
--- gcc/config/arm/arm.c.jj	2020-09-12 13:36:27.619716335 +0200
52d91f
+++ gcc/config/arm/arm.c	2020-09-12 13:49:26.166363387 +0200
52d91f
@@ -3181,7 +3181,7 @@ static sbitmap isa_quirkbits;
52d91f
 void
52d91f
 arm_configure_build_target (struct arm_build_target *target,
52d91f
 			    struct cl_target_option *opts,
52d91f
-			    struct gcc_options *opts_set,
52d91f
+			    struct gcc_options */* opts_set */,
52d91f
 			    bool warn_compatible)
52d91f
 {
52d91f
   const cpu_option *arm_selected_tune = NULL;
52d91f
@@ -3196,7 +3196,7 @@ arm_configure_build_target (struct arm_b
52d91f
   target->core_name = NULL;
52d91f
   target->arch_name = NULL;
52d91f
 
52d91f
-  if (opts_set->x_arm_arch_string)
52d91f
+  if (opts->x_arm_arch_specified)
52d91f
     {
52d91f
       arm_selected_arch = arm_parse_arch_option_name (all_architectures,
52d91f
 						      "-march",
52d91f
@@ -3204,7 +3204,7 @@ arm_configure_build_target (struct arm_b
52d91f
       arch_opts = strchr (opts->x_arm_arch_string, '+');
52d91f
     }
52d91f
 
52d91f
-  if (opts_set->x_arm_cpu_string)
52d91f
+  if (opts->x_arm_cpu_specified)
52d91f
     {
52d91f
       arm_selected_cpu = arm_parse_cpu_option_name (all_cores, "-mcpu",
52d91f
 						    opts->x_arm_cpu_string);
52d91f
@@ -3214,7 +3214,7 @@ arm_configure_build_target (struct arm_b
52d91f
 	 options for tuning.  */
52d91f
     }
52d91f
 
52d91f
-  if (opts_set->x_arm_tune_string)
52d91f
+  if (opts->x_arm_tune_specified)
52d91f
     {
52d91f
       arm_selected_tune = arm_parse_cpu_option_name (all_cores, "-mtune",
52d91f
 						     opts->x_arm_tune_string);
52d91f
--- gcc/common/config/arm/arm-common.c.jj	2020-07-28 15:39:09.705760394 +0200
52d91f
+++ gcc/common/config/arm/arm-common.c	2020-09-12 13:50:09.021738456 +0200
52d91f
@@ -1021,6 +1021,34 @@ arm_asm_auto_mfpu (int argc, const char
52d91f
 
52d91f
 #undef ARM_CPU_NAME_LENGTH
52d91f
 
52d91f
+bool
52d91f
+arm_handle_option (struct gcc_options *opts,
52d91f
+		   struct gcc_options *opts_set ATTRIBUTE_UNUSED,
52d91f
+		   const struct cl_decoded_option *decoded,
52d91f
+		   location_t loc ATTRIBUTE_UNUSED)
52d91f
+{
52d91f
+  size_t code = decoded->opt_index;
52d91f
+  const char *arg = decoded->arg;
52d91f
+  int val = decoded->value;
52d91f
+
52d91f
+  switch (code)
52d91f
+    {
52d91f
+    case OPT_march_:
52d91f
+      opts->x_arm_arch_specified = true;
52d91f
+      return true;
52d91f
+
52d91f
+    case OPT_mcpu_:
52d91f
+      opts->x_arm_cpu_specified = true;
52d91f
+      return true;
52d91f
+
52d91f
+    case OPT_mtune_:
52d91f
+      opts->x_arm_tune_specified = true;
52d91f
+      return true;
52d91f
+
52d91f
+    default:
52d91f
+      return true;
52d91f
+    }
52d91f
+}
52d91f
 
52d91f
 #undef  TARGET_DEFAULT_TARGET_FLAGS
52d91f
 #define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG)
52d91f
@@ -1031,4 +1059,7 @@ arm_asm_auto_mfpu (int argc, const char
52d91f
 #undef TARGET_EXCEPT_UNWIND_INFO
52d91f
 #define TARGET_EXCEPT_UNWIND_INFO  arm_except_unwind_info
52d91f
 
52d91f
+#undef  TARGET_HANDLE_OPTION
52d91f
+#define TARGET_HANDLE_OPTION arm_handle_option
52d91f
+
52d91f
 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;