From 474636f3e8519be55085b1ebcc915fde47068343 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sat, 30 Jul 1994 18:18:55 -0400 Subject: [PATCH] (fold_truthop): Apply masks to constants. From-SVN: r7839 --- gcc/fold-const.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index fd17f1a5644..5254b3ef99e 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,