]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/6981 (wrong code in 64-bit manipulation on x86)
authorJakub Jelinek <jakub@gcc.gnu.org>
Thu, 24 Oct 2002 17:11:56 +0000 (19:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 24 Oct 2002 17:11:56 +0000 (19:11 +0200)
* config/i386/i386.md (subdi3_1): Add call to ix86_binary_operator_ok.
PR target/6981
* config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok.
* gcc.c-torture/execute/20021024-1.c: New test.

From-SVN: r58497

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

index c30bd15baec1cd01555ed7d63dda15252c64ee06..a9f03f10d7b4686ddae946a7a51b570430afb558 100644 (file)
@@ -1,3 +1,12 @@
+2002-10-22  Jim Wilson  <wilson@redhat.com>
+
+       * config/i386/i386.md (subdi3_1): Add call to ix86_binary_operator_ok.
+
+2002-10-15  Jim Wilson  <wilson@redhat.com>
+
+       PR target/6981
+       * config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok.
+
 2002-10-24  Richard Henderson  <rth@redhat.com>
 
        PR opt/7944
index 4275675ce159ebf188c511c2f3ba0f2717f705b7..36a0497818ebf1f3b935293e6a2cb3e23c0e1605 100644 (file)
        (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
                 (match_operand:DI 2 "general_operand" "roiF,riF")))
    (clobber (reg:CC 17))]
-  "!TARGET_64BIT"
+  "!TARGET_64BIT && ix86_binary_operator_ok (PLUS, DImode, operands)"
   "#")
 
 (define_split
        (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
                  (match_operand:DI 2 "general_operand" "roiF,riF")))
    (clobber (reg:CC 17))]
-  "!TARGET_64BIT"
+  "!TARGET_64BIT && ix86_binary_operator_ok (MINUS, DImode, operands)"
   "#")
 
 (define_split
index 7d4131bbc02f03a4af35dd805c4154706f027d1c..ccd13075c7ae622099daf4f1bf3f6bf6cd2d77ce 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-24  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/execute/20021024-1.c: New test.
+
 2002-10-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/8067
diff --git a/gcc/testsuite/gcc.c-torture/execute/20021024-1.c b/gcc/testsuite/gcc.c-torture/execute/20021024-1.c
new file mode 100644 (file)
index 0000000..f7d98e9
--- /dev/null
@@ -0,0 +1,43 @@
+/* Origin: PR target/6981 from Mattias Engdegaard <mattias@virtutech.se>.  */
+
+void exit (int);
+void abort (void);
+
+unsigned long long *cp, m;
+
+void foo (void)
+{
+}
+
+void bar (unsigned rop, unsigned long long *r)
+{
+  unsigned rs1, rs2, rd;
+
+top:
+  rs2 = (rop >> 23) & 0x1ff;
+  rs1 = (rop >> 9) & 0x1ff;
+  rd = rop & 0x1ff;
+
+  *cp = 1;
+  m = r[rs1] + r[rs2];
+  *cp = 2;
+  foo();
+  if (!rd)
+    goto top;
+  r[rd] = 1;
+}
+
+int main(void)
+{
+  static unsigned long long r[64];
+  unsigned long long cr;
+  cp = &cr;
+
+  r[4] = 47;
+  r[8] = 11;
+  bar((8 << 23) | (4 << 9) | 15, r);
+
+  if (m != 47 + 11)
+    abort ();
+  exit (0);
+}