aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2002-05-27 14:40:38 +0000
committerAndrew Haley <aph@gcc.gnu.org>2002-05-27 14:40:38 +0000
commit57f851a378793094a5a2630bfe3b0b7927f6e39d (patch)
treebf8fc37775452fe22590c83cbb3ba0123a89b2b3 /gcc/fold-const.c
parent1802ffac65ef0324ffa44d1b5d91a83d2e0cb396 (diff)
downloadgcc-57f851a378793094a5a2630bfe3b0b7927f6e39d.zip
gcc-57f851a378793094a5a2630bfe3b0b7927f6e39d.tar.gz
gcc-57f851a378793094a5a2630bfe3b0b7927f6e39d.tar.bz2
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 686fd41c..e917301 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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)
{