(fold_truthop): Apply masks to constants.

From-SVN: r7839
This commit is contained in:
Richard Kenner 1994-07-30 18:18:55 -04:00
parent 910d169398
commit 474636f3e8

View File

@ -2836,12 +2836,14 @@ fold_truthop (code, truth_type, lhs, rhs)
l_const = convert (unsigned_type (TREE_TYPE (l_const)), l_const); l_const = convert (unsigned_type (TREE_TYPE (l_const)), l_const);
l_const = const_binop (LSHIFT_EXPR, convert (type, l_const), l_const = const_binop (LSHIFT_EXPR, convert (type, l_const),
size_int (xll_bitpos), 0); size_int (xll_bitpos), 0);
l_const = const_binop (BIT_AND_EXPR, l_const, ll_mask);
} }
if (r_const) if (r_const)
{ {
r_const = convert (unsigned_type (TREE_TYPE (r_const)), r_const); r_const = convert (unsigned_type (TREE_TYPE (r_const)), r_const);
r_const = const_binop (LSHIFT_EXPR, convert (type, r_const), r_const = const_binop (LSHIFT_EXPR, convert (type, r_const),
size_int (xrl_bitpos), 0); 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, /* If the right sides are not constant, do the same for it. Also,