(fold_truthop): Apply masks to constants.
From-SVN: r7839
This commit is contained in:
parent
910d169398
commit
474636f3e8
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user