This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix ICE in i386.md addqi_1_slp


Hi!

Committed as obvious, there are only 2 operands and operands[1]
is the one that we want to test for incdec_operand.

2004-10-18  Jakub Jelinek  <jakub@redhat.com>

	* 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.

--- gcc/config/i386/i386.md.jj	2004-09-01 13:07:56.000000000 +0200
+++ gcc/config/i386/i386.md	2004-10-18 14:45:42.651919193 +0200
@@ -6326,7 +6326,7 @@
     }
 }
   [(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")])
--- gcc/testsuite/gcc.c-torture/compile/20041018-1.c.jj	2004-10-18 14:49:02.639009210 +0200
+++ gcc/testsuite/gcc.c-torture/compile/20041018-1.c	2004-10-18 14:48:27.000000000 +0200
@@ -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];
+}

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]