===================================================================
@@ -18911,6 +18911,9 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_t
{
rtx (*gen) (rtx, rtx, rtx, rtx) = NULL;
+ if (!nonimmediate_operand (op_true, mode))
+ op_true = force_reg (mode, op_true);
+
op_false = force_reg (mode, op_false);
switch (mode)
===================================================================
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse4" } */
+
+void
+test (int code, unsigned int * image, int * colors)
+{
+ int i;
+
+ for (i = 0; i < code; ++i)
+ image[i] = (colors[i] < 0 ? ~(unsigned int) 0 : colors[i]);
+}