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]

[PATCH] sparc64 TImode fixes


Hi!

The testcase below causes an ICE on sparc64, because gcc initially wants to
use multi3 to compute the array size and only in a later pass it optimizes
it out to a mere DImode multiply. Two places were never expecting TImode (or
SUBREG) to be thrown on them), plus the sparc.h change makes sparc 64bit
libgcc.a provide __multi3 and stuff like that, which might be used sometimes
with -O0.
Ok to commit?

2000-09-23  Jakub Jelinek  <jakub@redhat.com>

	* config/sparc/sparc.c (sparc_emit_set_const64): Don't abort when
	op0 is a SUBREG.
	(function_arg_slotno): Accept TImode/CTImode.
	* config/sparc/sparc.h (MIN_UNITS_PER_WORD): If IN_LIBGCC2 define
	to UNITS_PER_WORD.

	* gcc.c-torture/compile/20000923-1.c: New test.

--- gcc/config/sparc/sparc.c.jj	Fri Aug 25 14:22:29 2000
+++ gcc/config/sparc/sparc.c	Sat Sep 23 17:21:56 2000
@@ -1832,12 +1832,17 @@ sparc_emit_set_const64 (op0, op1)
   rtx temp;
 
   /* Sanity check that we know what we are working with.  */
-  if (! TARGET_ARCH64
-      || GET_CODE (op0) != REG
-      || (REGNO (op0) >= SPARC_FIRST_FP_REG
-	  && REGNO (op0) <= SPARC_LAST_V9_FP_REG))
+  if (! TARGET_ARCH64)
     abort ();
 
+  if (GET_CODE (op0) != SUBREG)
+    {
+      if (GET_CODE (op0) != REG
+	  || (REGNO (op0) >= SPARC_FIRST_FP_REG
+	      && REGNO (op0) <= SPARC_LAST_V9_FP_REG))
+	abort ();
+    }
+
   if (reload_in_progress || reload_completed)
     temp = op0;
   else
@@ -3971,6 +3976,7 @@ function_arg_slotno (cum, mode, type, na
     case HImode : case CHImode :
     case SImode : case CSImode :
     case DImode : case CDImode :
+    case TImode : case CTImode :
       if (slotno >= SPARC_INT_ARG_MAX)
 	return -1;
       regno = regbase + slotno;
--- gcc/config/sparc/sparc.h.jj	Tue Aug 15 12:02:17 2000
+++ gcc/config/sparc/sparc.h	Sat Sep 23 17:03:00 2000
@@ -765,7 +765,11 @@ extern struct sparc_cpu_select sparc_sel
 
 /* Width of a word, in units (bytes).  */
 #define UNITS_PER_WORD		(TARGET_ARCH64 ? 8 : 4)
+#ifdef IN_LIBGCC2
+#define MIN_UNITS_PER_WORD	UNITS_PER_WORD
+#else
 #define MIN_UNITS_PER_WORD	4
+#endif
 
 /* Now define the sizes of the C data types.  */
 
--- gcc/testsuite/gcc.c-torture/compile/20000923-1.c.jj	Sat Sep 23 18:37:24 2000
+++ gcc/testsuite/gcc.c-torture/compile/20000923-1.c	Sat Sep 23 18:36:01 2000
@@ -0,0 +1,8 @@
+const int a = 3;
+const int b = 50;
+
+void foo (void)
+{
+  long int x[a][b];
+  asm ("" : : "r" (x) : "memory");
+}

	Jakub

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