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

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

From-SVN: r257874

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.h

index 730ab68fc389e349e3390e849142103fc99e2a64..14326080acdd97edd89dedd4aa66929412e2776e 100644 (file)
@@ -1,3 +1,11 @@
+2018-02-21  Martin Liska  <mliska@suse.cz>
+
+       PR driver/83193
+       * config/aarch64/aarch64.c (aarch64_print_hint_for_core_or_arch):
+       Add "native" as a possible value.
+       * config/aarch64/aarch64.h (HAVE_LOCAL_CPU_DETECT):  Define
+       the macro when native cpu detection is available.
+
 2018-02-21  Martin Liska  <mliska@suse.cz>
 
        PR driver/83193
index e1fb87f047f9f091cb1eaf053f434f45ed422123..33c90ef02dc135bb2b761a0767d773b1bebce881 100644 (file)
@@ -10628,6 +10628,13 @@ aarch64_print_hint_for_core_or_arch (const char *str, bool arch)
   const struct processor *entry = arch ? all_architectures : all_cores;
   for (; entry->name != NULL; entry++)
     candidates.safe_push (entry->name);
+
+#ifdef HAVE_LOCAL_CPU_DETECT
+  /* Add also "native" as possible value.  */
+  if (arch)
+    candidates.safe_push ("native");
+#endif
+
   char *s;
   const char *hint = candidates_list_and_hint (str, s, candidates);
   if (hint)
index e3c52f63683506a4f5164d55b0812f62b1c2f455..976f9afae54c1c98c22a4d5002d8d94e33b3190a 100644 (file)
@@ -1002,6 +1002,7 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv);
 
 #if defined(__aarch64__)
 extern const char *host_detect_local_cpu (int argc, const char **argv);
+#define HAVE_LOCAL_CPU_DETECT
 # define EXTRA_SPEC_FUNCTIONS                                          \
   { "local_cpu_detect", host_detect_local_cpu },                       \
   MCPU_TO_MARCH_SPEC_FUNCTIONS