]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
simplify-rtx.c (simplify_relational_operation_1): Avoid creating zero extensions...
authorRoger Sayle <roger@eyesopen.com>
Tue, 8 Feb 2005 03:38:26 +0000 (03:38 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Tue, 8 Feb 2005 03:38:26 +0000 (03:38 +0000)
* simplify-rtx.c (simplify_relational_operation_1): Avoid creating
zero extensions of BImode operands.  Call lowpart_subreg instead
of gen_lowpart_common and gen_lowpart_SUBREG.

From-SVN: r94730

gcc/ChangeLog
gcc/simplify-rtx.c

index adc920625eaac43dda09adc824ae283268626a2d..fbd956b273d4ff0f5cfe36960765c0489bb67dae 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-07  Roger Sayle  <roger@eyesopen.com>
+
+       * simplify-rtx.c (simplify_relational_operation_1): Avoid creating
+       zero extensions of BImode operands.  Call lowpart_subreg instead
+       of gen_lowpart_common and gen_lowpart_SUBREG.
+
 2005-02-07  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        PR ada/19489
index a92fc3c71c675f3889955add7f1e625962248e98..95735e6f4cdc756941e82703de4e198d3a8a1bc4 100644 (file)
@@ -2886,19 +2886,12 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
       && op1 == const0_rtx
       && GET_MODE_CLASS (mode) == MODE_INT
       && cmp_mode != VOIDmode
+      && cmp_mode != BImode
       && nonzero_bits (op0, cmp_mode) == 1
       && STORE_FLAG_VALUE == 1)
-    {
-      rtx tmp;
-      if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode))
-       return simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode);
-      tmp = gen_lowpart_common (mode, op0);
-      if (tmp)
-       return tmp;
-      if (GET_MODE (op0) != mode)
-       return gen_lowpart_SUBREG (mode, op0);
-      return op0;
-    }
+    return GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode)
+          ? simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode)
+          : lowpart_subreg (mode, op0, cmp_mode);
 
   return NULL_RTX;
 }