fold-const.c (fold): Don't convert (T)(x & c) into (T)x & (T)c if T is a boolean...
authorAndrew Haley <aph@redhat.com>
Mon, 27 May 2002 14:40:38 +0000 (14:40 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Mon, 27 May 2002 14:40:38 +0000 (14:40 +0000)
2002-05-24  Andrew Haley  <aph@redhat.com>

        * fold-const.c (fold): Don't convert (T)(x & c) into (T)x & (T)c
        if T is a boolean type.

From-SVN: r53929

gcc/ChangeLog
gcc/fold-const.c

index fa8828173d08893921d3b9c3443aea35d8c10d50..302a7d4703dbbbd29e72e2a1720b288cc7eb954d 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-24  Andrew Haley  <aph@redhat.com>
+
+       * fold-const.c (fold): Don't convert (T)(x & c) into (T)x & (T)c
+       if T is a boolean type.
+
 2002-05-27  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * basic-block.h (last_basic_block): Defined as synonym for
index 686fd41ce0021dbd8c8798d369e92b8592b40a18..e9173019fcd242fcd6454d330157af2214102e07 100644 (file)
@@ -4784,6 +4784,7 @@ fold (expr)
         constants (if x has signed type, the sign bit cannot be set
         in c).  This folds extension into the BIT_AND_EXPR.  */
       if (INTEGRAL_TYPE_P (TREE_TYPE (t))
+         && TREE_CODE (TREE_TYPE (t)) != BOOLEAN_TYPE
          && TREE_CODE (TREE_OPERAND (t, 0)) == BIT_AND_EXPR
          && TREE_CODE (TREE_OPERAND (TREE_OPERAND (t, 0), 1)) == INTEGER_CST)
        {