This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] fix OPTIONS_DEFAULT_SPEC for i386


So, if you configure --with-arch and --with-tune, in particular different architectures (like pentium-m and generic for example), the specs in OPTIONS_DEFAULT_SPEC will fill in the appropriate -march and -mtune value for you. Unfortunately for x86 it won't do that quite right at the moment. Right now -mtune defaults in OPTIONS_DEFAULT_SPEC to looking at whether or not -march (as well as -mcpu and -mtune) has been passed along the command line before determining whether or not to pass the default -mtune value. Unfortunately as ordered the march value was substituted by default first and made -mtune not be passed along which gave a tuning of the default arch value, not the default tune value.

So, the choices are:

a) reorder the specs (what the patch does)
b) depend tune and cpu only on tune and cpu, not arch.

OK? Choice b? Some choice I haven't noticed?

If we go with choice a) I'll also be putting a comment in that the order is important.

-eric

2006-07-19 Eric Christopher <echristo@apple.com>

* config/i386/i386.h (OPTIONS_DEFAULT_SPEC): Reorder.
Index: i386.h
===================================================================
--- i386.h	(revision 115533)
+++ i386.h	(working copy)
@@ -283,9 +283,9 @@ extern const char *host_detect_local_cpu
 
 /* Support for configure-time defaults of some command line options.  */
 #define OPTION_DEFAULT_SPECS \
-  {"arch", "%{!march=*:-march=%(VALUE)}"}, \
   {"tune", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
-  {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }
+  {"cpu", "%{!mtune=*:%{!mcpu=*:%{!march=*:-mtune=%(VALUE)}}}" }, \
+  {"arch", "%{!march=*:-march=%(VALUE)}"}
 
 /* Specs for the compiler proper */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]