diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-05-17 13:06:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-05-17 13:06:21 +0000 |
commit | 1e17e15ae532b05910a7fc0c599a01839dd1b032 (patch) | |
tree | a24b798aed2e282c91f6d71952eb3bd67579425e /gcc/fold-const.c | |
parent | 74c11a6c4d7b55e0e903a99fe58dfd491ce4fc2c (diff) | |
download | gcc-1e17e15ae532b05910a7fc0c599a01839dd1b032.zip gcc-1e17e15ae532b05910a7fc0c599a01839dd1b032.tar.gz gcc-1e17e15ae532b05910a7fc0c599a01839dd1b032.tar.bz2 |
fold-const.c (fold_unary): Fold the cast into a BIT_AND_EXPR only for an INTEGER_TYPE.
* fold-const.c (fold_unary) <CASE_CONVERT>: Fold the cast into
a BIT_AND_EXPR only for an INTEGER_TYPE.
From-SVN: r135467
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c167bc4..dc1e182 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) { |