===================================================================
@@ -3652,7 +3652,7 @@ expand_smod_pow2 (enum machine_mode mode
modulus. By including the signbit in the operation, many targets
can avoid an explicit compare operation in the following comparison
against zero. */
- wide_int mask = wi::mask (logd, false, GET_MODE_PRECISION (mode));
+ wide_int mask = wi::mask (logd, false, prec);
mask = wi::set_bit (mask, prec - 1);
temp = expand_binop (mode, and_optab, op0,
@@ -3667,7 +3667,7 @@ expand_smod_pow2 (enum machine_mode mode
temp = expand_binop (mode, sub_optab, result, const1_rtx, result,
0, OPTAB_LIB_WIDEN);
- mask = wi::mask (logd, true, GET_MODE_PRECISION (mode));
+ mask = wi::mask (logd, true, prec);
temp = expand_binop (mode, ior_optab, temp,
immed_wide_int_const (mask, mode),
result, 1, OPTAB_LIB_WIDEN);
===================================================================
@@ -7175,8 +7175,7 @@ fold_plusminus_mult_expr (location_t loc
arg10 = build_one_cst (type);
/* As we canonicalize A - 2 to A + -2 get rid of that sign for
the purpose of this canonicalization. */
- if (TYPE_SIGN (TREE_TYPE (arg1)) == SIGNED
- && wi::neg_p (arg1)
+ if (wi::neg_p (arg1, TYPE_SIGN (TREE_TYPE (arg1)))
&& negate_expr_p (arg1)
&& code == PLUS_EXPR)
{
===================================================================
@@ -1422,7 +1422,7 @@ real_to_integer (const REAL_VALUE_TYPE *
words = (precision + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT;
- for (int i = 0; i < 2 * MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT; i++)
+ for (unsigned int i = 0; i < ARRAY_SIZE (val); i++)
val[i] = 0;
#if (HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG)
@@ -2205,16 +2205,11 @@ real_from_integer (REAL_VALUE_TYPE *r, e
r->cl = rvc_normal;
r->sign = wi::neg_p (val_in, sgn);
- if (len == 0)
- len = 1;
-
/* We have to ensure we can negate the largest negative number. */
wide_int val = wide_int::from (val_in, maxbitlen, sgn);
if (r->sign)
val = -val;
- else
- val = val;
/* Ensure a multiple of HOST_BITS_PER_WIDE_INT, ceiling, as elt
won't work with precisions that are not a multiple of