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: [RFC] ABI compatibility with vendor compiler on SPARC/Solaris


> Should GCC adopt the conventions of the vendor compiler as of GCC 3.4? 
> They are technically superior, because you can't move a value between
> integer regs and FP regs on SPARC without spilling it to memory.

I finally decided to make the switch, after seeing that Alpha already did so 
for 3.4 in order to be compatible with the Tru64 compiler.

So the patch fixes the last failures in the compat testsuite in 32-bit mode 
against the Sun ONE Studio 8 compiler.  It was bootstrapped/regtested on 
sparc-sun-solaris2.[5678] and compat-regtested.

Applied to mainline and 3.4 branch.  As suggested by Gerald, I'll prepare a 
summary of the ABI changes on SPARC, much like what was done for MIPS.


2004-01-27  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* config/sparc/sparc.c (function_arg_pass_by_reference): Return 1
	for SCmode and DCmode if ARCH32.
	(sparc_va_arg): Handle SCmode and DCmode by reference if ARCH32.
	* config/sparc/sparc.h (RETURN_IN_MEMORY): Return 0 for TCmode
	if ARCH32.
	(BASE_RETURN_VALUE_REG): Return 32 for all FP modes except TFmode
	if ARCH32.
	(BASE_OUTGOING_VALUE_REG): Likewise.	


-- 
Eric Botcazou
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.278
diff -u -p -r1.278 sparc.c
--- config/sparc/sparc.c	23 Jan 2004 09:16:56 -0000	1.278
+++ config/sparc/sparc.c	23 Jan 2004 11:40:35 -0000
@@ -5564,7 +5564,10 @@ function_arg_pass_by_reference (const st
   if (TARGET_ARCH32)
     {
       return ((type && AGGREGATE_TYPE_P (type))
-	      || mode == TFmode || mode == TCmode);
+	      || mode == TFmode
+	      || mode == SCmode
+	      || mode == DCmode
+	      || mode == TCmode);
     }
   else
     {
@@ -5769,6 +5772,8 @@ sparc_va_arg (tree valist, tree type)
     {
       if (AGGREGATE_TYPE_P (type)
 	  || TYPE_MODE (type) == TFmode
+	  || TYPE_MODE (type) == SCmode
+	  || TYPE_MODE (type) == DCmode
 	  || TYPE_MODE (type) == TCmode)
 	{
 	  indirect = 1;
Index: config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.236
diff -u -p -r1.236 sparc.h
--- config/sparc/sparc.h	9 Nov 2003 14:05:10 -0000	1.236
+++ config/sparc/sparc.h	23 Jan 2004 11:40:45 -0000
@@ -1157,8 +1157,7 @@ extern int sparc_mode_class[];
 #define RETURN_IN_MEMORY(TYPE)				\
 (TARGET_ARCH32						\
  ? (TYPE_MODE (TYPE) == BLKmode				\
-    || TYPE_MODE (TYPE) == TFmode			\
-    || TYPE_MODE (TYPE) == TCmode)			\
+    || TYPE_MODE (TYPE) == TFmode)			\
  : (TYPE_MODE (TYPE) == BLKmode				\
     && (unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > 32))
 
@@ -1657,13 +1656,13 @@ extern char leaf_reg_remap[];
 #define BASE_RETURN_VALUE_REG(MODE)					\
   (TARGET_ARCH64							\
    ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32 : 8)			\
-   : (((MODE) == SFmode || (MODE) == DFmode) && TARGET_FPU ? 32 : 8))
+   : (TARGET_FPU && FLOAT_MODE_P (MODE) && (MODE) != TFmode ? 32 : 8))
 
 #define BASE_OUTGOING_VALUE_REG(MODE)				\
   (TARGET_ARCH64						\
    ? (TARGET_FPU && FLOAT_MODE_P (MODE) ? 32			\
       : TARGET_FLAT ? 8 : 24)					\
-   : (((MODE) == SFmode || (MODE) == DFmode) && TARGET_FPU ? 32	\
+   : (TARGET_FPU && FLOAT_MODE_P (MODE) && (MODE) != TFmode ? 32\
       : (TARGET_FLAT ? 8 : 24)))
 
 #define BASE_PASSING_ARG_REG(MODE)				\

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