diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 8403a07839f64a814f7c5d3fda279f4062d080b9..94296bc773b91ccd8176c40a587370a32f085c75 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -22394,7 +22394,7 @@
 	    (match_operand:V 2 "const0_operand"))
 	  (match_parallel 3 "movq_parallel"
 	    [(match_operand 4 "const_int_operand")])))]
-  "ix86_pre_reload_split ()"
+  "TARGET_SSE2 && ix86_pre_reload_split ()"
   "#"
   "&& 1"
   [(set (match_dup 0)
diff --git a/gcc/testsuite/gcc.target/i386/sse-pr101007.c b/gcc/testsuite/gcc.target/i386/sse-pr101007.c
new file mode 100644
index 0000000000000000000000000000000000000000..65261d2adc6c46f35170ac9c31fbeaaf407d61db
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/sse-pr101007.c
@@ -0,0 +1,14 @@
+/* PR target/101007 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse -mno-sse2" } */
+
+typedef unsigned __attribute__((__vector_size__ (8))) U;
+typedef unsigned __attribute__((__vector_size__ (16))) V;
+V v;
+U *p;
+
+void
+foo (void)
+{
+  *p = (U) __builtin_shufflevector ((V)(0 == (V){} >= 0), v, 4, 2);
+}