re PR middle-end/26379 (ICE on vector shift RTL simplification)
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Feb 2006 08:09:08 +0000 (09:09 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Feb 2006 08:09:08 +0000 (09:09 +0100)
PR middle-end/26379
* combine.c (simplify_shift_const_1): Disable nested shifts
optimization for vector shifts.

* gcc.target/i386/mmx-7.c: New test.

From-SVN: r111328

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/mmx-7.c [new file with mode: 0644]

index 0349d92cb0ba52ce44a10fad1d9446ee71ed10e1..eee818bb408acecf6e8e121da0f6f5e141031fc6 100644 (file)
@@ -1,3 +1,9 @@
+2006-02-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/26379
+       * combine.c (simplify_shift_const_1): Disable nested shifts
+       optimization for vector shifts.
+
 2006-02-20  Roger Sayle  <roger@eyesopen.com>
 
        PR tree-optimization/26361
index 96ebd208a825730ae623a5acc1e7d167a46bd652..9240b32568af9c3a889cce6e73977775394daf91 100644 (file)
@@ -8737,7 +8737,8 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
              && INTVAL (XEXP (varop, 1)) >= 0
              && INTVAL (XEXP (varop, 1)) < GET_MODE_BITSIZE (GET_MODE (varop))
              && GET_MODE_BITSIZE (result_mode) <= HOST_BITS_PER_WIDE_INT
-             && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
+             && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+             && !VECTOR_MODE_P (result_mode))
            {
              enum rtx_code first_code = GET_CODE (varop);
              unsigned int first_count = INTVAL (XEXP (varop, 1));
index cf2d999a3268b7786a6839e062689c3f384e8d8f..266489f94507e3980c037b41381cd65bdb692754 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/26379
+       * gcc.target/i386/mmx-7.c: New test.
+
 2006-02-20  Roger Sayle  <roger@eyesopen.com>
 
        PR tree-optimization/26361
diff --git a/gcc/testsuite/gcc.target/i386/mmx-7.c b/gcc/testsuite/gcc.target/i386/mmx-7.c
new file mode 100644 (file)
index 0000000..683ca10
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR middle-end/26379 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mmmx" } */
+
+#include <mmintrin.h>
+
+void
+foo (__m64 *p)
+{
+  __m64 m;
+
+  m = p[0];
+  m = _mm_srli_pi16(m, 2);
+  m = _mm_slli_pi16(m, 8);
+
+  p[0] = m;
+  _mm_empty();
+}