re PR target/5357 (SPARC: illegal (?) combination of -mcpu=supersparc and -m64 causes...
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Jan 2002 15:21:51 +0000 (16:21 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Jan 2002 15:21:51 +0000 (16:21 +0100)
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.

From-SVN: r48909

gcc/ChangeLog
gcc/config/sparc/sparc.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20020116-2.c [new file with mode: 0644]

index 5c262ab4a80b7af120f13d3c0957439ab4450181..64d7ce42884f97741ddd5c989d027343cce3ecf8 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2002-01-16  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.c (s390_emit_prologue): Do not emit USE
index 8914a8b331494ceb66baaea895fda1fa80dcc89f..3e3d1a8e1cced0e1b131eb116718714892559b9c 100644 (file)
@@ -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)
index fc714f86179cb226913e61ef27fc0535307a6434..28eeb14be3e5a69a663fb48020cafa29d62b3dd2 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/20020116-2.c: New test.
+
 2002-01-15  Geoffrey Keating  <geoffk@redhat.com>
 
        * gcc.dg/20020103-1.c: Also test for __PPC__, since that's used
diff --git a/gcc/testsuite/gcc.dg/20020116-2.c b/gcc/testsuite/gcc.dg/20020116-2.c
new file mode 100644 (file)
index 0000000..04f5c6e
--- /dev/null
@@ -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);
+    }
+}