This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Pass -mtune and -march options to assembler.
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Valdimir Volynsky <vvv at ru dot ru>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 24 May 2009 23:15:30 +0200
- Subject: Re: [PATCH] Pass -mtune and -march options to assembler.
- References: <web-655551951@zbackend1.aha.ru>
2009/5/24 Valdimir Volynsky <vvv@ru.ru>:
> Hi!
>
> GNU Assembler support optimization options, but GCC does not pass -mtune and
> -march options to assembler. For full optimization it's required to use this
> option twice:
>
> # gcc ... -mtune=core2 -Wa,-mtune=core2
>
> There is no default passing optimization options from GCC to AS. But many
> programmers imply that passing. It's very strange to optimize code on
> GCC-level and do not optimize on assembler level.
>
> This patch fixes PR 40171 by passing optimization options
> -mtune and -march to the assembler.
>
> 2009-05-25 ?Vladimir Volynsky ?<vvv@ru.ru>
>
> ? ? ? ?PR target/40171
> ? ? ? ?* gcc.c (process_command): Pass -mtune and -march
> ? ? ? ?options to the assembler.
>
> --- gcc/gcc.c ? 2009-05-25 00:26:47.000000000 +0400
> +++ gcc/gcc.c.vv ? ? ? ?2009-05-25 00:31:45.000000000 +0400
> @@ -3744,6 +3744,18 @@ process_command (int argc, const char **
> ? ? ? ?print_multi_os_directory = 1;
> ? ? ? else if (! strcmp (argv[i], "-print-sysroot-headers-suffix"))
> ? ? ? ?print_sysroot_headers_suffix = 1;
> + ? ? ?else if (! strncmp (argv[i], "-mtune", 6))
> + ? ? ? {
> + ? ? ? ? /* Pass -mtune option to the assembler.
> + ? ? ? ? ? ?This option can be overridden by assembler option -Wa, */
> + ? ? ? ? add_assembler_option (argv[i], strlen ( argv[i] ) );
> + ? ? ? }
> + ? ? ?else if (! strncmp (argv[i], "-march", 6))
> + ? ? ? {
> + ? ? ? ? /* Pass -march option to the assembler.
> + ? ? ? ? ? ?This option can be overridden by assembler option -Wa, */
> + ? ? ? ? add_assembler_option (argv[i], strlen ( argv[i] ) );
> + ? ? ? }
> ? ? ? else if (! strncmp (argv[i], "-Wa,", 4))
> ? ? ? ?{
> ? ? ? ? ?int prev, j;
>
> Ok for trunk?
No. This doesn't work for assemblers other than GNU as.
Richard.
> Regards,
> ?Vladimir Volynsky
> ---
> Professional hosting for everyone - http://www.host.ru
>