re PR rtl-optimization/20412 (RTL checking failure in the combiner)
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 10 Mar 2005 22:13:01 +0000 (22:13 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 10 Mar 2005 22:13:01 +0000 (14:13 -0800)
PR rtl-opt/20412
* simplify-rtx.c (simplify_relational_operation_1): Fix typo - check the
correct mode.

PR rtl-opt/20412
* gcc.c-torture/compile/pr20412.c: New test.

From-SVN: r96264

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr20412.c [new file with mode: 0644]

index 18efe597a39509fa01c0deaf97fa3e234c34a4b1..0cd964faa7dd489d996b1c8a13e2c52e225a3200 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-10  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR rtl-opt/20412
+       * simplify-rtx.c (simplify_relational_operation_1): Fix typo - check the
+       correct mode.
+
 2005-03-10  Roger Sayle  <roger@eyesopen.com>
 
        * builtins.c (expand_builtin_signbit): Extend to handle floating
index 8a1b9bb4805689ea083ec5cd52560a595258cb70..2f7ae25c57e6158e0e1b81def139ef891428d2a6 100644 (file)
@@ -2882,7 +2882,7 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
          /* If op0 is a comparison, extract the comparison arguments form it.  */
          if (code == NE)
            {
-             if (GET_MODE (op0) == cmp_mode)
+             if (GET_MODE (op0) == mode)
                return simplify_rtx (op0);
              else
                return simplify_gen_relational (GET_CODE (op0), mode, VOIDmode,
index bee3e6499bf8bf6413b15ffef0b89844f0d7f748..bb8b8fe58642979bbc9e03eb58866ad55c58479a 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-10  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR rtl-opt/20412
+       * gcc.c-torture/compile/pr20412.c: New test.
+
 2005-03-10  Roger Sayle  <roger@eyesopen.com>
 
        * gcc.dg/builtins-32.c: Add new run-time tests for long double.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr20412.c b/gcc/testsuite/gcc.c-torture/compile/pr20412.c
new file mode 100644 (file)
index 0000000..a165a92
--- /dev/null
@@ -0,0 +1,20 @@
+int
+foo(void)
+{
+  int      a,b,g;
+  int      i,len;
+  int      stop;
+                                                                     
+  len = 10;
+  stop = 0;
+  for (i=0; i<len; i++)
+  {
+    a = bar1() ? 0 : 1;
+    b = bar2() ? 0 : 1;
+    g = bar3() ? 0 : 1;
+                                                                     
+    if (stop = ((a+b) % 2 != g)) break;
+  }
+  return stop;
+}