From 57f851a378793094a5a2630bfe3b0b7927f6e39d Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 27 May 2002 14:40:38 +0000 Subject: [PATCH] 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 * 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 | 5 +++++ gcc/fold-const.c | 1 + 2 files changed, 6 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa8828173d0..302a7d4703d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-24 Andrew Haley + + * 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 * basic-block.h (last_basic_block): Defined as synonym for diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 686fd41ce00..e9173019fcd 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) { -- 2.30.2