re PR rtl-optimization/55686 (ICE in assign_by_spills, at lra-assigns.c:1244)
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Jan 2013 16:41:30 +0000 (17:41 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 22 Jan 2013 16:41:30 +0000 (17:41 +0100)
PR target/55686
* config/i386/i386.md (UNSPEC_STOS): New.
(strset_singleop, *strsetdi_rex_1, *strsetsi_1, *strsethi_1,
*strsetqi_1): Add UNSPEC_STOS.

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

From-SVN: r195381

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

index 79054466dbe21a4d608ce70b4ce9fc29f8a56271..fa4def9bddcd37728fa80903e3e8203b62438585 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/55686
+       * config/i386/i386.md (UNSPEC_STOS): New.
+       (strset_singleop, *strsetdi_rex_1, *strsetsi_1, *strsethi_1,
+       *strsetqi_1): Add UNSPEC_STOS.
+
 2013-01-22  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/56067
index 531b62d8b2acf7b04d8b975cf664d0096cc159f9..96f6dcd59294ad1c8454c0c8e5c8da5e3f65528d 100644 (file)
   UNSPEC_PAUSE
   UNSPEC_LEA_ADDR
   UNSPEC_XBEGIN_ABORT
+  UNSPEC_STOS
 
   ;; For SSE/MMX support:
   UNSPEC_FIX_NOTRUNC
   [(parallel [(set (match_operand 1 "memory_operand")
                   (match_operand 2 "register_operand"))
              (set (match_operand 0 "register_operand")
-                  (match_operand 3))])]
+                  (match_operand 3))
+             (unspec [(const_int 0)] UNSPEC_STOS)])]
   ""
   "ix86_current_function_needs_cld = 1;")
 
        (match_operand:DI 2 "register_operand" "a"))
    (set (match_operand:P 0 "register_operand" "=D")
        (plus:P (match_dup 1)
-               (const_int 8)))]
+               (const_int 8)))
+   (unspec [(const_int 0)] UNSPEC_STOS)]
   "TARGET_64BIT
    && !(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
   "%^stosq"
        (match_operand:SI 2 "register_operand" "a"))
    (set (match_operand:P 0 "register_operand" "=D")
        (plus:P (match_dup 1)
-               (const_int 4)))]
+               (const_int 4)))
+   (unspec [(const_int 0)] UNSPEC_STOS)]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
   "%^stos{l|d}"
   [(set_attr "type" "str")
        (match_operand:HI 2 "register_operand" "a"))
    (set (match_operand:P 0 "register_operand" "=D")
        (plus:P (match_dup 1)
-               (const_int 2)))]
+               (const_int 2)))
+   (unspec [(const_int 0)] UNSPEC_STOS)]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
   "%^stosw"
   [(set_attr "type" "str")
        (match_operand:QI 2 "register_operand" "a"))
    (set (match_operand:P 0 "register_operand" "=D")
        (plus:P (match_dup 1)
-               (const_int 1)))]
+               (const_int 1)))
+   (unspec [(const_int 0)] UNSPEC_STOS)]
   "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
   "%^stosb"
   [(set_attr "type" "str")
index c3d6f9eefe5c943df3aa207a4a6e9cc8188555d0..f3694db3ecca637d5b0eac157fcabb78b14106e2 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/55686
+       * gcc.target/i386/pr55686.c: New test.
+
 2013-01-22  Dodji Seketeli  <dodji@redhat.com>
 
        PR c++/53609
diff --git a/gcc/testsuite/gcc.target/i386/pr55686.c b/gcc/testsuite/gcc.target/i386/pr55686.c
new file mode 100644 (file)
index 0000000..a263b08
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR target/55686 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (long x, long *y)
+{
+  long *a = y - 64, i;
+  for (i = 0; i < x; i++)
+    {
+      long v = y[i];
+      *a++ = v;
+    }
+  register void **c __asm__ ("di");
+  goto **c;
+}