This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Add "native" as a valid option value for -march= on arm (PR driver/83193).
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, James Greenhalgh <james dot greenhalgh at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Date: Wed, 21 Feb 2018 08:34:22 +0100
- Subject: Add "native" as a valid option value for -march= on arm (PR driver/83193).
- Authentication-results: sourceware.org; auth=none
- References: <f6ef8fc4-43b4-8e1a-34ef-3379ea4d69c7@suse.cz>
Hi.
This is equivalent patch for ARM target.
Ready for trunk?
Thanks,
Martin
>From 656a883bc5239439ba80743f15a8df704501ee71 Mon Sep 17 00:00:00 2001
From: marxin <mliska@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 <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.
---
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
+
char *s;
const char *hint = candidates_list_and_hint (target, s, candidates);
if (hint)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 6f3c4f461b9..bbf3937a592 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -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 \
--
2.16.1