This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Pass -mtune and -march options to assembler.
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: 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
- Date: Fri, 05 Jun 2009 07:57:13 +0100
- Subject: Re: [PATCH] Pass -mtune and -march options to assembler.
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <4A1EBF3A.email@example.com> <firstname.lastname@example.org> <4A203D91.email@example.com> <firstname.lastname@example.org> <4A2058B8.email@example.com> <firstname.lastname@example.org> <4A214E03.email@example.com> <firstname.lastname@example.org> <Pine.LNX.email@example.com> <firstname.lastname@example.org> <4A27FE68.email@example.com>
Mark Mitchell <firstname.lastname@example.org> writes:
> Valdimir Volynsky wrote:
>> 2009-06-04 Vladimir Volynsky <email@example.com>
>> PR target/40171
>> * config/i386/linux64.h (ASM_SPEC): Pass -mtune to the GNU assembler.
>> * config/i386/mingw-w64.h (ASM_SPEC): Likewise.
>> * config/i386/sol2-10.h (ASM_SPEC): Likewise.
>> * config/i386/x86-64.h (ASM_SPEC): Likewise.
> Sorry to keep going around on this -- but why not put directives in the
> .s file? You're already conditionalizing on HAVE_GNU_AS, so you know
> you're using the GNU assembler.
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". We don't
require users to hard-code the tune target in C files (in the form
of pragmas, etc.) so it would be inconsistent to require them to
hard-code the tune target in asm code. (The role of the tuning target
is exactly the same in both: optimise for the given processor within
the limits imposed by the current architecture.)
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. (IA64 doesn't
pass it down, but I can't find a comment explaining why, or any indication
that this is deliberate.)