OSDN Git Service

gcc/
authorfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Jan 2008 18:31:19 +0000 (18:31 +0000)
committerfroydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Jan 2008 18:31:19 +0000 (18:31 +0000)
PR 31535
* config/rs6000/rs6000.c (small_data_operand): Vectors and floats
are not legitimate small data references on SPE targets.

gcc/testsuite/
PR 31535
* gcc.target/powerpc/spe-small-data-1.c: New test.
* gcc.target/powerpc/spe-small-data-2.c: New test.

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

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c [new file with mode: 0644]

index 46fabaa..753539e 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-28  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR 31535
+       * config/rs6000/rs6000.c (small_data_operand): Vectors and floats
+       are not legitimate small data references on SPE targets.
+
 2008-01-28  David Daney  <ddaney@avtrex.com>
 
        * doc/install.texi (mips-*-*): Recommend binutils 2.18.
index 586c481..4ebea38 100644 (file)
@@ -3238,6 +3238,13 @@ small_data_operand (rtx op ATTRIBUTE_UNUSED,
   if (DEFAULT_ABI != ABI_V4)
     return 0;
 
+  /* Vector and float memory instructions have a limited offset on the
+     SPE, so using a vector or float variable directly as an operand is
+     not useful.  */
+  if (TARGET_SPE
+      && (SPE_VECTOR_MODE (mode) || FLOAT_MODE_P (mode)))
+    return 0;
+
   if (GET_CODE (op) == SYMBOL_REF)
     sym_ref = op;
 
index c13e906..465fc8a 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-28  Nathan Froyd  <froydnj@codesourcery.com>
+
+       PR 31535
+       * gcc.target/powerpc/spe-small-data-1.c: New test.
+       * gcc.target/powerpc/spe-small-data-2.c: New test.
+
 2008-01-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR libfortran/34980
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c b/gcc/testsuite/gcc.target/powerpc/spe-small-data-1.c
new file mode 100644 (file)
index 0000000..8bdb154
--- /dev/null
@@ -0,0 +1,14 @@
+/* Verify that we don't ICE trying to put SPE data in .sdata2.  */
+/* { dg-do run { target { powerpc*-*-linux* && powerpc_spe } } } */
+/* { dg-options "-msdata=eabi -mcall-eabi -G 8" } */
+
+#include <spe.h>
+
+__ev64_fs__ x;
+
+int main(void)
+{
+  x = __ev_fsabs (x);
+  return(0);
+}
+
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c b/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
new file mode 100644 (file)
index 0000000..2a466e3
--- /dev/null
@@ -0,0 +1,12 @@
+/* Verify that we don't ICE trying to put float data in .sdata2.  */
+/* { dg-do run { target { powerpc*-*-linux* && powerpc_spe } } } */
+/* { dg-options "-msdata=eabi -mcall-eabi -G 8" } */
+
+double x;
+
+int main(void)
+{
+  x = x * 2;
+  return(0);
+}
+