This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Pass -mtune and -march options to assembler.
- From: "Valdimir Volynsky" <vvv at ru dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 May 2009 01:01:27 +0400
- Subject: [PATCH] Pass -mtune and -march options to assembler.
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?
Regards,
Vladimir Volynsky
---
Professional hosting for everyone - http://www.host.ru