]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/6290 (ICE compiling altivec code with 3.1)
authorJakub Jelinek <jakub@redhat.com>
Mon, 15 Apr 2002 22:39:10 +0000 (00:39 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 15 Apr 2002 22:39:10 +0000 (00:39 +0200)
PR c/6290
* config/rs6000/rs6000.c (easy_vector_constant): Return 1 if the
CONST_VECTOR is { 0, ... 0 }.

* gcc.dg/altivec-5.c: New test.

From-SVN: r52340

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/altivec-5.c [new file with mode: 0644]

index bb849b8af6001a9ff780ed6b1910a37eac5291d8..915a13c7a2bddb8a945b96041ce8eb1ae75d7286 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-16  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/6290
+       * config/rs6000/rs6000.c (easy_vector_constant): Return 1 if the
+       CONST_VECTOR is { 0, ... 0 }.
+
 2002-04-15  Loren J. Rittle  <ljrittle@acm.org>
 
        * doc/install.texi (Installing GCC: Configuration): Clarify
index 99e7af6cd3071a8be21eadd70b854ff7e550d749..04098107f752b902d3b018612f1283b55cb6fbdf 100644 (file)
@@ -1219,18 +1219,24 @@ easy_vector_constant (op)
         with CONST0_RTX for the current mode, but let's be safe
         instead.  */
 
-      if (GET_CODE (elt) == CONST_INT && INTVAL (elt) != 0)
-       return 0;
-
-      if (GET_CODE (elt) == CONST_DOUBLE
-              && (CONST_DOUBLE_LOW (elt) != 0
-                  || CONST_DOUBLE_HIGH (elt) != 0))
-       return 0;
+      switch (GET_CODE (elt))
+       {
+       case CONST_INT:
+         if (INTVAL (elt) != 0)
+           return 0;
+         break;
+       case CONST_DOUBLE:
+         if (CONST_DOUBLE_LOW (elt) != 0 || CONST_DOUBLE_HIGH (elt) != 0)
+           return 0;
+         break;
+       default:
+         return 0;
+       }
     }
 
   /* We could probably generate a few other constants trivially, but
      gcc doesn't generate them yet.  FIXME later.  */
-  return 0;
+  return 1;
 }
 
 /* Return 1 if the operand is the constant 0.  This works for scalars
index 4fa62b357ba3d7276a27bb94437a373bc59d12e8..f5f85153d5961e6fe82a7ca4f228be96414b7d1c 100644 (file)
@@ -1,3 +1,7 @@
+2002-04-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/altivec-5.c: New test.
+
 2002-04-15  Mark Mitchell  <mark@codesourcery.com>
 
        * testsuite/lib/chill.exp: Remove.
diff --git a/gcc/testsuite/gcc.dg/altivec-5.c b/gcc/testsuite/gcc.dg/altivec-5.c
new file mode 100644 (file)
index 0000000..61d19d9
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile { target powerpc-*-* } } */
+/* { dg-options "-maltivec -O2" } */
+
+#define vector __attribute__((vector_size(16)))
+
+void foo (const unsigned long x,
+         vector signed int a, vector signed int b)
+{
+  unsigned char d[64];
+
+  __builtin_altivec_stvewx (b, 0, d);
+}