i386.md (addqi_1_slp): Test for incdec_operand operand 1 instead of 2
authorJakub Jelinek <jakub@redhat.com>
Mon, 18 Oct 2004 13:01:36 +0000 (15:01 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 18 Oct 2004 13:01:36 +0000 (15:01 +0200)
* config/i386/i386.md (addqi_1_slp): Test for incdec_operand
operand 1 instead of 2

* gcc.c-torture/compile/20041018-1.c: New test.

From-SVN: r89212

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20041018-1.c [new file with mode: 0644]

index 58131c0..8d7553e 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/i386/i386.md (addqi_1_slp): Test for incdec_operand
+       operand 1 instead of 2
+
 2004-10-18  Kazu Hirata  <kazu@cs.umass.edu>
 
        * loop-unroll.c: Fix comment typos.
index 168f2f3..ce9f8bc 100644 (file)
     }
 }
   [(set (attr "type")
-     (if_then_else (match_operand:QI 2 "incdec_operand" "")
+     (if_then_else (match_operand:QI 1 "incdec_operand" "")
        (const_string "incdec")
        (const_string "alu1")))
    (set_attr "mode" "QI")])
index cebee0f..0b2038a 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-18  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/compile/20041018-1.c: New test.
+
 2004-10-18  Ben Elliston  <bje@au.ibm.com>
 
        * gcc.dg/ppc-sdata-1.c: Update to consider the possibility of the
diff --git a/gcc/testsuite/gcc.c-torture/compile/20041018-1.c b/gcc/testsuite/gcc.c-torture/compile/20041018-1.c
new file mode 100644 (file)
index 0000000..3cc0c8f
--- /dev/null
@@ -0,0 +1,18 @@
+void
+foo (int y, int z, unsigned char **t, int **c, int *b)
+{
+  int i, j, k;
+  unsigned char a[2];
+
+  a[0] = 0;
+  a[1] = 0;
+  for (j = 0; j < z; j++)
+    for (i = 0; i < y; i++, a[0] += 3)
+      for (k = 0; k < 3; k++)
+       c[0][k] += 3 * b[k];
+  for (i = 0; i < 3; i++)
+    if (t[0][i] + c[0][i] / a[0] <= 0)
+      t[0][i] = 0;
+    else
+      t[0][i] = t[0][i] + c[0][i] / a[0];
+}