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] Fix PR target/5357


Hi!

I've commited the following fix for 5357.
Although -m64 -mcpu=supersparc is very weird thing to do, we shouldn't ICE
on any input...
SPARC backend is assuming that only one of TARGET_V8, TARGET_V9,
TARGET_SPARCLET and TARGET_SPARCLITE can be set.

Can anyone please close the PR (don't have GNATS write access)?

2002-01-16  Jakub Jelinek  <jakub@redhat.com>

	PR target/5357:
	* config/sparc/sparc.c (sparc_override_options): Avoid MASK_V9 and
	MASK_V8 being both set.

	* gcc.dg/20020116-2.c: New test.

--- gcc/config/sparc/sparc.c.jj	Thu Dec 27 13:49:49 2001
+++ gcc/config/sparc/sparc.c	Wed Jan 16 17:19:32 2002
@@ -401,7 +401,10 @@ sparc_override_options ()
      are available.
      -m64 also implies v9.  */
   if (TARGET_VIS || TARGET_ARCH64)
-    target_flags |= MASK_V9;
+    {
+      target_flags |= MASK_V9;
+      target_flags &= ~(MASK_V8 | MASK_SPARCLET | MASK_SPARCLITE);
+    }
 
   /* Use the deprecated v8 insns for sparc64 in 32 bit mode.  */
   if (TARGET_V9 && TARGET_ARCH32)
--- gcc/testsuite/gcc.dg/20020116-2.c.jj	Wed Jan 16 17:35:40 2002
+++ gcc/testsuite/gcc.dg/20020116-2.c	Wed Jan 16 17:37:21 2002
@@ -0,0 +1,18 @@
+/* This testcase ICEd on sparc64 because -mcpu=supersparc and implicit
+   -m64 resulted in MASK_V8 and MASK_V9 to be set at the same time.  */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-options "-mcpu=supersparc" { target sparc*-*-* } } */
+
+void bar (long *x, long *y);
+
+void foo (int x, long *y, long *z)
+{
+  int i;
+
+  for (i = x - 1; i >= 0; i--)
+    {
+      bar (z + i * 3 + 1, y);
+      bar (z + i * 3 + 2, y);
+    }
+}

	Jakub


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