altivec-8.c: New.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 2 May 2002 02:03:14 +0000 (02:03 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 2 May 2002 02:03:14 +0000 (02:03 +0000)
2002-05-02  Aldy Hernandez  <aldyh@redhat.com>

        * gcc.dg/altivec-8.c: New.

        * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow
        PRE_INC and PRE_DEC for altivec modes.

From-SVN: r53031

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

index 2eff31d7dcf1f009aca69baeb63ff6f6193e62b9..59a01f251b01cb11655c8aedaf989ea308dea52f 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-02  Aldy Hernandez  <aldyh@redhat.com>
+
+        * gcc.dg/altivec-8.c: New.
+
+        * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow
+        PRE_INC and PRE_DEC for altivec modes.
+
 2002-05-01  Jeff Law  <law@redhat.com>
 
        * pa.h (EXTRA_CONSTRAINT): Don't accept PIC addresses for the
index 235090005a52d60382600ab0d849f9ed6c5110d4..6a1c5a658656bbef6296ba69c49b57b725e51ff2 100644 (file)
@@ -2048,6 +2048,7 @@ rs6000_legitimate_address (mode, x, reg_ok_strict)
   if (LEGITIMATE_INDIRECT_ADDRESS_P (x, reg_ok_strict))
     return 1;
   if ((GET_CODE (x) == PRE_INC || GET_CODE (x) == PRE_DEC)
+      && !ALTIVEC_VECTOR_MODE (mode)
       && TARGET_UPDATE
       && LEGITIMATE_INDIRECT_ADDRESS_P (XEXP (x, 0), reg_ok_strict))
     return 1;
index 3e14731d41ca7ed0efe959e9915b994fb5a248b9..e12dc075440aa95ef711adbe98a47a5bbf190f9b 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-02  Aldy Hernandez  <aldyh@redhat.com>
+
+        * gcc.dg/altivec-8.c: New.
+
 2002-05-01  Aldy Hernandez  <aldyh@redhat.com>
 
         * gcc.dg/altivec-7.c: New.
diff --git a/gcc/testsuite/gcc.dg/altivec-8.c b/gcc/testsuite/gcc.dg/altivec-8.c
new file mode 100644 (file)
index 0000000..2d6803a
--- /dev/null
@@ -0,0 +1,18 @@
+/* Origin: Aldy Hernandez  <aldyh@redhat.com>  */
+/* Test rs6000_legitimate_address.  PRE_INC should be invalid.  */
+
+/* { dg-do compile { target powerpc-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+vector signed short *hannah;
+
+int
+main ()
+{
+  *hannah++ = __builtin_altivec_vspltish (5);
+  *hannah++ = __builtin_altivec_vspltish (6);
+
+  return 0;
+}