re PR target/48678 (unable to find a register to spill in class ‘GENERAL_REGS’)
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Apr 2011 16:47:06 +0000 (18:47 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 19 Apr 2011 16:47:06 +0000 (18:47 +0200)
PR target/48678
* config/i386/i386.md (movstrict<mode>): FAIL if operands[0]
is a SUBREG with non-MODE_INT mode inside of it.

* gcc.target/i386/pr48678.c: New test.

From-SVN: r172721

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr48678.c [new file with mode: 0644]

index 5c44ebda4f4c72adeccc8112f41c8ef1589366cf..959d07b80084e2ae9a5ce9e69370fa5eca27ca57 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/48678
+       * config/i386/i386.md (movstrict<mode>): FAIL if operands[0]
+       is a SUBREG with non-MODE_INT mode inside of it.
+
 2011-04-19  Martin Jambor  <mjambor@suse.cz>
 
        * ipa-cp.c (ipcp_process_devirtualization_opportunities): Devirtualize
index 0e0ceed4260b4391ec5e5543c8d22f4827abbc9e..38bdcd30c100d270dff2f1e5fc3c5148cd305f22 100644 (file)
 {
   if (TARGET_PARTIAL_REG_STALL && optimize_function_for_speed_p (cfun))
     FAIL;
+  if (GET_CODE (operands[0]) == SUBREG
+      && GET_MODE_CLASS (GET_MODE (SUBREG_REG (operands[0]))) != MODE_INT)
+    FAIL;
   /* Don't generate memory->memory moves, go through a register */
   if (MEM_P (operands[0]) && MEM_P (operands[1]))
     operands[1] = force_reg (<MODE>mode, operands[1]);
index 71c4556ea0e0c2c87bd81c0fd5119ea425ab80e7..0d47ecfb65d8875314698b2920fc822c9b720591 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/48678
+       * gcc.target/i386/pr48678.c: New test.
+
 2011-04-19  Martin Jambor  <mjambor@suse.cz>
 
        * g++.dg/opt/devirt1.C: Bump to -O2, remove XFAIL.
diff --git a/gcc/testsuite/gcc.target/i386/pr48678.c b/gcc/testsuite/gcc.target/i386/pr48678.c
new file mode 100644 (file)
index 0000000..6f6727f
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR target/48678 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+
+typedef short T __attribute__((may_alias));
+struct S { __m128i d; };
+
+__m128i
+foo (short *x, struct S *y, __m128i *z)
+{
+  struct S s = *y;
+  ((T *) &s.d)[0] = *x;
+  return _mm_cmpeq_epi16 (s.d, *z);
+}