2012-04-27 Paolo Bonzini <bonzini@gnu.org>
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Apr 2012 12:17:50 +0000 (12:17 +0000)
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Apr 2012 12:17:50 +0000 (12:17 +0000)
        PR target/53138
        * config/i386/i386.md (x86_mov<mode>cc_0_m1_neg): Add clobber.

testsuite:
2012-04-27  Paolo Bonzini  <bonzini@gnu.org>

        PR target/53138
        * gcc.c-torture/execute/20120427-1.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186904 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 88b54ac..152bbe1 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-27  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/53138
+       * config/i386/i386.md (x86_mov<mode>cc_0_m1_neg): Add clobber.
+
 2012-04-27  Richard Guenther  <rguenther@suse.de>
 
        * tree-flow.h (is_hidden_global_store): Remove.
index 60439f9..28d2f9e 100644 (file)
 (define_insn "*x86_mov<mode>cc_0_m1_neg"
   [(set (match_operand:SWI48 0 "register_operand" "=r")
        (neg:SWI48 (match_operator 1 "ix86_carry_flag_operator"
-                   [(reg FLAGS_REG) (const_int 0)])))]
+                   [(reg FLAGS_REG) (const_int 0)])))
+   (clobber (reg:CC FLAGS_REG))]
   ""
   "sbb{<imodesuffix>}\t%0, %0"
   [(set_attr "type" "alu")
index 2109f5d..0c41cc5 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-27  Paolo Bonzini  <bonzini@gnu.org>
+
+       PR target/53138
+       * gcc.c-torture/execute/20120427-1.c: New testcase.
+
 2012-04-27  Marc Glisse  <marc.glisse@inria.fr>
 
        PR middle-end/27139
diff --git a/gcc/testsuite/gcc.c-torture/execute/20120427-1.c b/gcc/testsuite/gcc.c-torture/execute/20120427-1.c
new file mode 100644 (file)
index 0000000..46ed76a
--- /dev/null
@@ -0,0 +1,36 @@
+typedef struct sreal
+{
+  unsigned sig;                /* Significant.  */
+  int exp;             /* Exponent.  */
+} sreal;
+
+sreal_compare (sreal *a, sreal *b)
+{
+  if (a->exp > b->exp)
+    return 1;
+  if (a->exp < b->exp)
+    return -1;
+  if (a->sig > b->sig)
+    return 1;
+  return -(a->sig < b->sig);
+}
+
+sreal a[] = {
+   { 0, 0 },
+   { 1, 0 },
+   { 0, 1 },
+   { 1, 1 }
+};
+
+int main()
+{
+  int i, j;
+  for (i = 0; i <= 3; i++) {
+    for (j = 0; j < 3; j++) {
+      if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort();
+      if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort();
+      if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort();
+    }
+  }
+  return 0;
+}