OSDN Git Service

* combine.c (force_to_mode) <NE_EXPR>: Only convert the expression
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Sep 2004 23:44:30 +0000 (23:44 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 30 Sep 2004 23:44:30 +0000 (23:44 +0000)
(AND (NE FOO 0) CONST) into (AND FOO CONST) if FOO has the same
machine mode as the result.

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

gcc/ChangeLog
gcc/combine.c

index b91dbef..0bc0811 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-30  Roger Sayle  <roger@eyesopen.com>
+
+       * combine.c (force_to_mode) <NE_EXPR>: Only convert the expression
+       (AND (NE FOO 0) CONST) into (AND FOO CONST) if FOO has the same
+       machine mode as the result.
+
 2004-09-30  Ben Elliston  <bje@au.ibm.com>
 
        PR bootstrap/17761
index 2c7fbf5..559ee15 100644 (file)
@@ -7338,6 +7338,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
         in STORE_FLAG_VALUE and FOO has a single bit that might be nonzero,
         which is equal to STORE_FLAG_VALUE.  */
       if ((mask & ~STORE_FLAG_VALUE) == 0 && XEXP (x, 1) == const0_rtx
+         && GET_MODE (XEXP (x, 0)) == mode
          && exact_log2 (nonzero_bits (XEXP (x, 0), mode)) >= 0
          && (nonzero_bits (XEXP (x, 0), mode)
              == (unsigned HOST_WIDE_INT) STORE_FLAG_VALUE))