This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Pass -mtune and -march options to assembler.
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Mark Mitchell <mark at codesourcery dot com>, Valdimir Volynsky <vvv at ru dot ru>, "Joseph S. Myers" <joseph at codesourcery dot com>, Dave Korn <dave dot korn dot cygwin at googlemail dot com>, gcc-patches at gcc dot gnu dot org, rdsandiford at googlemail dot com
- Date: Fri, 05 Jun 2009 08:39:23 -0700
- Subject: Re: [PATCH] Pass -mtune and -march options to assembler.
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <4A1EBF3A.firstname.lastname@example.org> <email@example.com> <4A203D91.firstname.lastname@example.org> <email@example.com> <4A2058B8.firstname.lastname@example.org> <email@example.com> <4A214E03.firstname.lastname@example.org> <email@example.com> <Pine.LNX.firstname.lastname@example.org> <email@example.com> <4A27FE68.firstname.lastname@example.org> <email@example.com>
Richard Sandiford wrote:
> My usual answer to this is that we want gcc to be consistent when
> used as a driver interface. So both of the following commands:
> gcc -mtune=foo blah.c
> gcc -mtune=foo blah.S
> should produce code that is tuned for architecture "foo".
That argument does not, however, argue for an assembler that uses
different names for the cores than GCC. :-)
We also want:
gcc -mtune=foo -S blah.c
as -o blah.o blah.s
to behave like:
gcc -c -mtune=foo blah.c
because, in practice, assembly files float away from the compiler for a
while, and then get assembled later.
So, I accept your argument as a good argument for having the assembler
have a -mtune= option, provided that it accepts the same cores as GCC
(including, possibly, a superset for backwards compatibility with its
current options), and provided that GCC uses .mtune in the .s file to
avoid possible miscommunication when using "-S".
> A quick grep suggests that the only other gas ports to support -mtune
> are MIPS and IA64. MIPS passes -mtune options down, so cross-platform
> consistency is another argument in favour of the patch.
However, ARM has the similar .march directive (apologies if that's not
the right spelling), and GCC uses that mechanism to communicate with the
assembler. So, cross-platform consistency in that respect argues for an
(650) 331-3385 x713