summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-17 13:06:21 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-17 13:06:21 +0000
commit101f2414cfe22a332a2e34115fa19181af69efe7 (patch)
treea24b798aed2e282c91f6d71952eb3bd67579425e /gcc/fold-const.c
parente9ee81a75f56f7f30836c53ecc6d230443db8593 (diff)
downloadgcc-101f2414cfe22a332a2e34115fa19181af69efe7.tar.gz
* fold-const.c (fold_unary) <CASE_CONVERT>: Fold the cast into
a BIT_AND_EXPR only for an INTEGER_TYPE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index c167bc4f670..dc1e182c16f 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7864,8 +7864,7 @@ fold_unary (enum tree_code code, tree type, tree op0)
/* Convert (T)(x & c) into (T)x & (T)c, if c is an integer
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 (type)
- && TREE_CODE (type) != BOOLEAN_TYPE
+ if (TREE_CODE (type) == INTEGER_TYPE
&& TREE_CODE (op0) == BIT_AND_EXPR
&& TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST)
{