&& tree_fits_uhwi_p (op2))
{
tree eltype = TREE_TYPE (TREE_TYPE (arg0));
- unsigned HOST_WIDE_INT width = tree_to_uhwi (TYPE_SIZE (eltype));
+ unsigned HOST_WIDE_INT width
+ = (TREE_CODE (eltype) == BOOLEAN_TYPE
+ ? TYPE_PRECISION (eltype) : tree_to_uhwi (TYPE_SIZE (eltype)));
unsigned HOST_WIDE_INT n = tree_to_uhwi (arg1);
unsigned HOST_WIDE_INT idx = tree_to_uhwi (op2);
t = gimple_assign_rhs1 (def_stmt);
}
if (bitpos)
- {
- if (TREE_CODE (type) == BOOLEAN_TYPE)
- {
- tree itype
- = build_nonstandard_integer_type (tree_to_uhwi (bitsize), 0);
- tree field = gimplify_build3 (gsi, BIT_FIELD_REF, itype, t,
- bitsize, bitpos);
- return gimplify_build2 (gsi, NE_EXPR, type, field,
- build_zero_cst (itype));
- }
- else
- return gimplify_build3 (gsi, BIT_FIELD_REF, type, t, bitsize, bitpos);
- }
+ return gimplify_build3 (gsi, BIT_FIELD_REF, type, t, bitsize, bitpos);
else
return gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t);
}