(all_ones_mask_p): Really use tmask.

(all_ones_mask_p): Declare tmask to be `tree'.
(optimize_bit_field_compare) Add missing semicolon.

(decode_field_reference): Use force_fit_type
instead of convert to avoid truncated integer warning.
(all_ones_mask_p): Likewise.

From-SVN: r3519
This commit is contained in:
Richard Stallman 1993-02-24 06:43:37 +00:00
parent 44735512c9
commit 13af526d4f
1 changed files with 9 additions and 4 deletions

View File

@ -2294,7 +2294,10 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
#endif
/* Make the mask to be used against the extracted field. */
mask = convert (unsigned_type, build_int_2 (~0, ~0));
mask = build_int_2 (~0, ~0);
TREE_TYPE (mask) = unsigned_type;
force_fit_type (mask);
mask = convert (unsigned_type, mask);
mask = const_binop (LSHIFT_EXPR, mask, size_int (lnbitsize - lbitsize), 0);
mask = const_binop (RSHIFT_EXPR, mask,
size_int (lnbitsize - lbitsize - lbitpos), 0);
@ -2451,13 +2454,15 @@ all_ones_mask_p (mask, size)
{
tree type = TREE_TYPE (mask);
int precision = TYPE_PRECISION (type);
tree tmask;
tmask = build_int_2 (~0, ~0);
TREE_TYPE (tmask) = signed_type (type);
force_fit_type (tmask);
return
operand_equal_p (mask,
const_binop (RSHIFT_EXPR,
const_binop (LSHIFT_EXPR,
convert (signed_type (type),
build_int_2 (~0, ~0)),
const_binop (LSHIFT_EXPR, tmask,
size_int (precision - size), 0),
size_int (precision - size), 0),
0);