OSDN Git Service

2002-05-02 Aldy Hernandez <aldyh@redhat.com>
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2002 02:03:14 +0000 (02:03 +0000)
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 2 May 2002 02:03:14 +0000 (02:03 +0000)
        * gcc.dg/altivec-8.c: New.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53031 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 2eff31d..59a01f2 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 2350900..6a1c5a6 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 3e14731..e12dc07 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;
+}