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] PR target/32787 (bootstrapping i386 with non-GCC compiler)


   GCC_VERSION is defined unconditionally by include/ansidecl.h, so the test
in config/i386/driver-i386.c to use cpuid.h only with GCC doesn't work,
causing failure to bootstrap with a non-GCC compiler on x86 platforms. This
patch fixes it by testing for __GNUC__ instead.

   The bug was reported for GCC 4.2.1 using Sun Studio 12 to bootstrap and
there's a similar failure when using OpenWatcom to bootstrap trunk.

   This patch is for trunk. I'll commit it as obvious once testing on
x86_64-unknown-linux-gnu finishes.

2007-11-03  Rask Ingemann Lambertsen  <rask@sygehus.dk>

	PR target/32787
	* config/i386/driver-i386.c: Test for __GNUC__ instead of
	GCC_VERSION which is always defined.

Index: gcc/config/i386/driver-i386.c
===================================================================
--- gcc/config/i386/driver-i386.c	(revision 129849)
+++ gcc/config/i386/driver-i386.c	(working copy)
@@ -25,7 +25,7 @@
 
 const char *host_detect_local_cpu (int argc, const char **argv);
 
-#ifdef GCC_VERSION
+#ifdef __GNUC__
 #include "cpuid.h"
 
 /* Returns parameters that describe L1_ASSOC associative cache of size
@@ -416,4 +416,4 @@
 
   return concat ("-m", argv[0], "=", cpu, NULL);
 }
-#endif /* GCC_VERSION */
+#endif /* __GNUC__ */

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year


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