Hi!

general_operand matches even CONST_INT, but none of the constraints would
allow it and we ICEd trying to reload it into a FLOAT_REGS register.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
approved by Uros in the PR, committed to trunk.

2012-02-29  Jakub Jelinek  <ja...@redhat.com>
            Uros Bizjak  <ubiz...@gmail.com>

        PR target/52437
        * config/i386/sse.md (vec_set<mode>_0): Swap "*r" and "fF"
        alternatives, add "e" constraint to the new last alternative
        and ! to last 3 alternatives.

        * gcc.c-torture/compile/pr52437.c: New test.

--- gcc/config/i386/sse.md.jj   2012-01-02 20:39:59.000000000 +0100
+++ gcc/config/i386/sse.md      2012-02-29 22:07:37.246132827 +0100
@@ -3895,13 +3895,13 @@ (define_expand "vec_init<mode>"
 ;; see comment above inline_secondary_memory_needed function in i386.c
 (define_insn "vec_set<mode>_0"
   [(set (match_operand:VI4F_128 0 "nonimmediate_operand"
-         "=x,x,x ,x,x,x,x  ,x  ,m,m ,m")
+         "=x,x,x ,x,x,x,x  ,x  ,m ,m   ,m")
        (vec_merge:VI4F_128
          (vec_duplicate:VI4F_128
            (match_operand:<ssescalarmode> 2 "general_operand"
-         " x,m,*r,m,x,x,*rm,*rm,x,fF,*r"))
+         " x,m,*r,m,x,x,*rm,*rm,!x,!*re,!*fF"))
          (match_operand:VI4F_128 1 "vector_move_operand"
-         " C,C,C ,C,0,x,0  ,x  ,0,0 ,0")
+         " C,C,C ,C,0,x,0  ,x  ,0 ,0   ,0")
          (const_int 1)))]
   "TARGET_SSE"
   "@
@@ -3921,9 +3921,9 @@ (define_insn "vec_set<mode>_0"
      (cond [(eq_attr "alternative" "0,6,7")
              (const_string "sselog")
            (eq_attr "alternative" "9")
-             (const_string "fmov")
-           (eq_attr "alternative" "10")
              (const_string "imov")
+           (eq_attr "alternative" "10")
+             (const_string "fmov")
           ]
           (const_string "ssemov")))
    (set_attr "prefix_extra" "*,*,*,*,*,*,1,1,*,*,*")
--- gcc/testsuite/gcc.c-torture/compile/pr52437.c.jj    2012-02-29 
22:09:39.231468064 +0100
+++ gcc/testsuite/gcc.c-torture/compile/pr52437.c       2012-02-29 
22:12:54.000000000 +0100
@@ -0,0 +1,18 @@
+/* PR target/52437 */
+
+int f, g, i, j;
+
+void
+fn1 ()
+{
+  for (;;)
+    {
+      fn2 ();
+      j = 1;
+      for (i = 0; i <= 3; i++)
+       {
+         for (g = 1; g >= 0; g--)
+           f = 0, j &= 11;
+       }
+    }
+}

        Jakub

Reply via email to