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]

Re: fix sparc bootstrap


> > Are you not unnecessarily pessimizing the Solaris case?
>
> I'm not convinced that it's much of a pessimization.

Sure, but penalizing everyone because of a feature that might never be 
implemented is a bit too masochist. ;-)

I've installed the attached patch.

Btw, the next time a SPARC/Linux enthusiast has some time to kill, it would be 
nice to re-implement config/sparc/linux64.h on top of config/sparc/linux.h.


2005-01-03  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Define to false.
	* config/sparc/linux.h (SPARC_RELAXED_ORDERING): Define to true.
	* config/sparc/linux64.h (SPARC_RELAXED_ORDERING): Likewise.
	* config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define to
	SPARC_RELAXED_ORDERING.

-- 
Eric Botcazou
Index: config/sparc/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux.h,v
retrieving revision 1.65
diff -u -r1.65 linux.h
--- config/sparc/linux.h	11 Nov 2004 03:18:01 -0000	1.65
+++ config/sparc/linux.h	3 Jan 2005 07:56:39 -0000
@@ -234,3 +234,9 @@
 #endif
 
 #define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
+
+/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
+   TMO, and TMO in multiprocessor mode.  But they reserve the right to
+   change their minds.  */
+#undef SPARC_RELAXED_ORDERING
+#define SPARC_RELAXED_ORDERING true
Index: config/sparc/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux64.h,v
retrieving revision 1.87
diff -u -r1.87 linux64.h
--- config/sparc/linux64.h	11 Nov 2004 03:18:02 -0000	1.87
+++ config/sparc/linux64.h	3 Jan 2005 07:56:40 -0000
@@ -371,3 +371,9 @@
 #endif
 
 #define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
+
+/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
+   TMO, and TMO in multiprocessor mode.  But they reserve the right to
+   change their minds.  */
+#undef SPARC_RELAXED_ORDERING
+#define SPARC_RELAXED_ORDERING true
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.351
diff -u -r1.351 sparc.c
--- config/sparc/sparc.c	30 Dec 2004 03:08:09 -0000	1.351
+++ config/sparc/sparc.c	3 Jan 2005 07:56:43 -0000
@@ -498,20 +498,8 @@
 #define TARGET_ATTRIBUTE_TABLE sparc_attribute_table
 #endif
 
-/* The SPARC v9 architecture defines a relaxed memory ordering model (RMO)
-   which requires this if enabled.  Prior to v9, there are no instructions
-   to even talk about memory syncronization.  The Ultra3 processor doesn't
-   implement RMO.
-
-   Solaris never enables RMO; only ever uses total memory ordering (TMO.
-
-   Linux currently uses RMO in uniprocessor mode, which is equivalent to
-   TMO, and TMO in multiprocessor mode.  But they reserve the right to
-   change their minds.  */
-/* ??? Getting the configury correct is harder than it's worth.  Just
-   enable it all the time.  */
 #undef TARGET_RELAXED_ORDERING
-#define TARGET_RELAXED_ORDERING true
+#define TARGET_RELAXED_ORDERING SPARC_RELAXED_ORDERING
 
 struct gcc_target targetm = TARGET_INITIALIZER;
 
Index: config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.270
diff -u -r1.270 sparc.h
--- config/sparc/sparc.h	30 Dec 2004 03:08:10 -0000	1.270
+++ config/sparc/sparc.h	3 Jan 2005 07:56:45 -0000
@@ -204,6 +204,16 @@
 
 #define SPARC_DEFAULT_CMODEL CM_32
 
+/* The SPARC-V9 architecture defines a relaxed memory ordering model (RMO)
+   which requires the following macro to be true if enabled.  Prior to V9,
+   there are no instructions to even talk about memory synchronization.
+   Note that the UltraSPARC III processors don't implement RMO, unlike the
+   UltraSPARC II processors.
+
+   Default to false; for example, Solaris never enables RMO, only ever uses
+   total memory ordering (TMO).  */
+#define SPARC_RELAXED_ORDERING false
+
 /* This is call-clobbered in the normal ABI, but is reserved in the
    home grown (aka upward compatible) embedded ABI.  */
 #define EMBMEDANY_BASE_REG "%g4"

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