Add "native" as a valid option value for -march= on arm (PR driver/83193).
authorMartin Liska <mliska@suse.cz>
Wed, 21 Feb 2018 14:05:17 +0000 (15:05 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 21 Feb 2018 14:05:17 +0000 (14:05 +0000)
2018-02-21  Martin Liska  <mliska@suse.cz>

PR driver/83193
* common/config/arm/arm-common.c (arm_print_hint_for_arch_option):
Add "native" as a possible value.
* config/arm/arm.h (HAVE_LOCAL_CPU_DETECT): Define the macro
when native cpu detection is available.

From-SVN: r257873

gcc/ChangeLog
gcc/common/config/arm/arm-common.c
gcc/config/arm/arm.h

index a07661b5d4a59c7146de9bb64c193e61d27ee5b2..730ab68fc389e349e3390e849142103fc99e2a64 100644 (file)
@@ -1,3 +1,11 @@
+2018-02-21  Martin Liska  <mliska@suse.cz>
+
+       PR driver/83193
+       * common/config/arm/arm-common.c (arm_print_hint_for_arch_option):
+       Add "native" as a possible value.
+       * config/arm/arm.h (HAVE_LOCAL_CPU_DETECT): Define the macro
+       when native cpu detection is available.
+
 2018-02-21  Jakub Jelinek  <jakub@redhat.com>
            Martin Sebor  <msebor@redhat.com>
 
index fc585e0b0eebce7ef899f84a94471170bc5b31e2..50f0bad3e36eb062e4eb6b7011d05589ab9b0363 100644 (file)
@@ -353,6 +353,12 @@ arm_print_hint_for_arch_option (const char *target,
   auto_vec<const char*> candidates;
   for (; list->common.name != NULL; list++)
     candidates.safe_push (list->common.name);
+
+#ifdef HAVE_LOCAL_CPU_DETECT
+  /* Add also "native" as possible value.  */
+  candidates.safe_push ("native");
+#endif
+
   char *s;
   const char *hint = candidates_list_and_hint (target, s, candidates);
   if (hint)
index 6f3c4f461b9b22e3587d93142a04d6f74a8aa2d5..bbf3937a592a14d35adbf3afcff0b6829cd5c584 100644 (file)
@@ -2194,6 +2194,7 @@ extern const char *arm_target_thumb_only (int argc, const char **argv);
    an ARM chip.  */
 #if defined(__arm__)
 extern const char *host_detect_local_cpu (int argc, const char **argv);
+#define HAVE_LOCAL_CPU_DETECT
 # define MCPU_MTUNE_NATIVE_FUNCTIONS                   \
   { "local_cpu_detect", host_detect_local_cpu },
 # define MCPU_MTUNE_NATIVE_SPECS                               \