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

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
This commit is contained in:
Andrew Haley 2002-05-27 14:40:38 +00:00 committed by Andrew Haley
parent 1802ffac65
commit 57f851a378
2 changed files with 6 additions and 0 deletions

View 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

View 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)
{