Blame SOURCES/gcc32-pr19005.patch

4ac4fd
2005-05-13  Jakub Jelinek  <jakub@redhat.com>
4ac4fd
4ac4fd
	PR target/19005
4ac4fd
	* config/i386/i386.md (swapqi): Use +q instead of +r constraints.
4ac4fd
4ac4fd
	* gcc.c-torture/execute/pr19005.c: New test.
4ac4fd
4ac4fd
--- gcc/config/i386/i386.md.jj	2004-07-01 12:40:54.000000000 +0200
4ac4fd
+++ gcc/config/i386/i386.md	2005-05-13 13:56:14.000000000 +0200
4ac4fd
@@ -2107,8 +2107,8 @@
4ac4fd
 })
4ac4fd
 
4ac4fd
 (define_insn "*swapqi"
4ac4fd
-  [(set (match_operand:QI 0 "register_operand" "+r")
4ac4fd
-	(match_operand:QI 1 "register_operand" "+r"))
4ac4fd
+  [(set (match_operand:QI 0 "register_operand" "+q")
4ac4fd
+	(match_operand:QI 1 "register_operand" "+q"))
4ac4fd
    (set (match_dup 1)
4ac4fd
 	(match_dup 0))]
4ac4fd
   ""
4ac4fd
--- gcc/testsuite/gcc.c-torture/execute/pr19005.c.jj	2005-04-07 15:51:53.775361896 +0200
4ac4fd
+++ gcc/testsuite/gcc.c-torture/execute/pr19005.c	2005-05-13 13:33:21.000000000 +0200
4ac4fd
@@ -0,0 +1,38 @@
4ac4fd
+/* PR target/19005 */
4ac4fd
+extern void abort (void);
4ac4fd
+
4ac4fd
+int v, s;
4ac4fd
+
4ac4fd
+void
4ac4fd
+bar (int a, int b)
4ac4fd
+{
4ac4fd
+  unsigned char x = v;
4ac4fd
+
4ac4fd
+  if (!s)
4ac4fd
+    {
4ac4fd
+      if (a != x || b != (unsigned char) (x + 1))
4ac4fd
+        abort ();
4ac4fd
+    }
4ac4fd
+  else if (a != (unsigned char) (x + 1) || b != x)
4ac4fd
+    abort ();
4ac4fd
+  s ^= 1;
4ac4fd
+}
4ac4fd
+
4ac4fd
+int
4ac4fd
+foo (int x)
4ac4fd
+{
4ac4fd
+  unsigned char a = x, b = x + 1;
4ac4fd
+
4ac4fd
+  bar (a, b);
4ac4fd
+  a ^= b; b ^= a; a ^= b;
4ac4fd
+  bar (a, b);
4ac4fd
+  return 0;
4ac4fd
+}
4ac4fd
+
4ac4fd
+int
4ac4fd
+main (void)
4ac4fd
+{
4ac4fd
+  for (v = -10; v < 266; v++)
4ac4fd
+    foo (v);
4ac4fd
+  return 0;
4ac4fd
+}