This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add "native" as a valid option value for -march= on arm (PR driver/83193).
- From: Martin Liška <mliska at suse dot cz>
- To: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, 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>
- Date: Thu, 22 Feb 2018 09:51:56 +0100
- Subject: Re: 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> <12f28b57-c526-c85e-5c9b-05fa5724cf17@suse.cz> <5A8D3A9A.3040202@foss.arm.com>
On 02/21/2018 10:23 AM, Kyrill Tkachov wrote:
>
> 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?
Hi.
Can you please test for me attached follow up patch?
Thanks,
Martin
>From 3a40e8a873461f9f06a18539cfb7c366dd6efafb Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 21 Feb 2018 15:38:32 +0100
Subject: [PATCH] Add "native" as a valid option value for -mcpu/-mtune= on arm
(PR driver/83193).
gcc/ChangeLog:
2018-02-21 Martin Liska <mliska@suse.cz>
PR driver/83193
* common/config/arm/arm-common.c (arm_print_hint_for_cpu_option):
Add "native" as a possible value.
---
gcc/common/config/arm/arm-common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/common/config/arm/arm-common.c b/gcc/common/config/arm/arm-common.c
index 50f0bad3e36..a404d4b1562 100644
--- a/gcc/common/config/arm/arm-common.c
+++ b/gcc/common/config/arm/arm-common.c
@@ -309,6 +309,12 @@ arm_print_hint_for_cpu_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)
--
2.16.1