This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add "native" as a valid option value for -march= on i386 (PR driver/83193).
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Liška <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>, richard dot sandiford at linaro dot org
- Date: Tue, 20 Feb 2018 17:06:37 +0100
- Subject: Re: [PATCH] Add "native" as a valid option value for -march= on i386 (PR driver/83193).
- Authentication-results: sourceware.org; auth=none
- References: <f6ef8fc4-43b4-8e1a-34ef-3379ea4d69c7@suse.cz> <87inarslf4.fsf@linaro.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Feb 20, 2018 at 03:58:07PM +0000, Richard Sandiford wrote:
> Martin Liška <mliska@suse.cz> writes:
> > Hi.
> >
> > Following patch adds "native" as a possible option for -march value on
> > i386 target. I have similar patches for other targets. Would it be
> > possible to install the patch in current stage?
>
> [...]
>
> > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> > index d54e7301e84..361d4df2663 100644
> > --- a/gcc/config/i386/i386.c
> > +++ b/gcc/config/i386/i386.c
> > @@ -4193,6 +4193,9 @@ ix86_option_override_internal (bool main_args_p,
> > || ((processor_alias_table[i].flags & PTA_64BIT) != 0)))
> > candidates.safe_push (processor_alias_table[i].name);
> >
> > + /* Add also "native" as possible value. */
> > + candidates.safe_push ("native");
> > +
> > char *s;
> > const char *hint
> > = candidates_list_and_hint (opts->x_ix86_arch_string, s, candidates);
>
> We should probably only do this if the driver supports -march=native.
> I think for x86 that means HAVE_LOCAL_CPU_DETECT.
Isn't the option available always? It just doesn't do anything if
/* If we are compiling with GCC where %EBX register is fixed, then the
driver will just ignore -march and -mtune "native" target and will leave
to the newly built compiler to generate code for its default target. */
Jakub