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]

Default settings of arch and cpu on ix86



With the current egcs (compiled for i486-pc-linux-gnu), egcs uses as
defaults -mcpu=i486 -march=pentium if no -mcpu/-march option is given.

The problem is the function override_options in gcc/config/i386/i386.c 
which has e.g.:
  if (ix86_arch_string == 0)
    {
      ix86_arch_string = PROCESSOR_PENTIUM_STRING;
      if (ix86_cpu_string == 0)
        ix86_cpu_string = PROCESSOR_DEFAULT_STRING;
    }

IMHO this should be changed to use PROCESSOR_DEFAULT for both arch and 
cpu.

and later:
      error ("bad value (%s) for -march= switch", ix86_arch_string);
      ix86_arch_string = PROCESSOR_PENTIUM_STRING;
      ix86_arch = PROCESSOR_DEFAULT;

This is wrong since arch_string and arch don't get the same value.

I'm appending a patch to clean up these two cases and ask for
inclusion in egcs.

Thanks,
Andreas


1999-06-07  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* config/i386/i386.c (override_options): Default arch and cpu are
	always PROCESSOR_DEFAULT.  Set ix86_arch_string and
	ix86_arch_cpu_string accordingly.

--- config/i386/i386.c.~1~	Fri May 28 08:37:56 1999
+++ config/i386/i386.c	Mon Jun  7 08:46:47 1999
@@ -291,7 +291,7 @@
 
   if (ix86_arch_string == 0)
     {
-      ix86_arch_string = PROCESSOR_PENTIUM_STRING;
+      ix86_arch_string = PROCESSOR_DEFAULT_STRING;
       if (ix86_cpu_string == 0)
 	ix86_cpu_string = PROCESSOR_DEFAULT_STRING;
     }
@@ -308,7 +308,7 @@
   if (i == ptt_size)
     {
       error ("bad value (%s) for -march= switch", ix86_arch_string);
-      ix86_arch_string = PROCESSOR_PENTIUM_STRING;
+      ix86_arch_string = PROCESSOR_DEFAULT_STRING;
       ix86_arch = PROCESSOR_DEFAULT;
     }
 



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


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