Hi Martin,

On 21/02/18 07:34, Martin Liška wrote:
Hi.

This is equivalent patch for ARM target.

Thanks for fixing this!

Ready for trunk?

Have you tested this with a native and a cross-compiler like the aarch64 
version?

Thanks,
Martin

From 656a883bc5239439ba80743f15a8df704501ee71 Mon Sep 17 00:00:00 2001
From: marxin<mli...@suse.cz>
Date: Tue, 20 Feb 2018 14:09:22 +0100
Subject: [PATCH 1/3] Add "native" as a valid option value for -march= on arm
 (PR driver/83193).

gcc/ChangeLog:

2018-02-20  Martin Liska<mli...@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.
---
 gcc/common/config/arm/arm-common.c | 6 ++++++
 gcc/config/arm/arm.h               | 1 +
 2 files changed, 7 insertions(+)

diff --git a/gcc/common/config/arm/arm-common.c 
b/gcc/common/config/arm/arm-common.c
index fc585e0b0ee..50f0bad3e36 100644
--- a/gcc/common/config/arm/arm-common.c
+++ b/gcc/common/config/arm/arm-common.c
@@ -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
+


On arm we also support "native" as a value for -mcpu and -mtune. These are both 
handled by
the arm_print_hint_for_cpu_option function in the same file. Can you please add 
this snippet
to them as well?

Thanks,
Kyrill

Reply via email to