aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-07-30 18:18:55 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-07-30 18:18:55 -0400
commit474636f3e8519be55085b1ebcc915fde47068343 (patch)
tree9f308f9a427b38532193b78185bd87129bca4170 /gcc
parent910d169398c8cc56032b7ae3d52bd7f0a856e818 (diff)
downloadgcc-474636f3e8519be55085b1ebcc915fde47068343.zip
gcc-474636f3e8519be55085b1ebcc915fde47068343.tar.gz
gcc-474636f3e8519be55085b1ebcc915fde47068343.tar.bz2
(fold_truthop): Apply masks to constants.
From-SVN: r7839
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index fd17f1a..5254b3e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2836,12 +2836,14 @@ fold_truthop (code, truth_type, lhs, rhs)
l_const = convert (unsigned_type (TREE_TYPE (l_const)), l_const);
l_const = const_binop (LSHIFT_EXPR, convert (type, l_const),
size_int (xll_bitpos), 0);
+ l_const = const_binop (BIT_AND_EXPR, l_const, ll_mask);
}
if (r_const)
{
r_const = convert (unsigned_type (TREE_TYPE (r_const)), r_const);
r_const = const_binop (LSHIFT_EXPR, convert (type, r_const),
size_int (xrl_bitpos), 0);
+ r_const = const_binop (BIT_AND_EXPR, r_const, rl_mask);
}
/* If the right sides are not constant, do the same for it. Also,