+2016-08-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/67485
+ * expmed.c (expand_mult_const): Change val_so_far's type to UHWI,
+ only cast it to SHWI for the final comparison.
+
2016-08-16 Martin Liska <mliska@suse.cz>
PR gcov-profile/36412
rtx target, const struct algorithm *alg,
enum mult_variant variant)
{
- HOST_WIDE_INT val_so_far;
+ unsigned HOST_WIDE_INT val_so_far;
rtx_insn *insn;
rtx accum, tem;
int opno;
tem = expand_shift (LSHIFT_EXPR, mode, op0, log, NULL_RTX, 0);
accum = force_operand (gen_rtx_PLUS (mode, accum, tem),
add_target ? add_target : accum_target);
- val_so_far += HOST_WIDE_INT_1 << log;
+ val_so_far += HOST_WIDE_INT_1U << log;
break;
case alg_sub_t_m2:
tem = expand_shift (LSHIFT_EXPR, mode, op0, log, NULL_RTX, 0);
accum = force_operand (gen_rtx_MINUS (mode, accum, tem),
add_target ? add_target : accum_target);
- val_so_far -= HOST_WIDE_INT_1 << log;
+ val_so_far -= HOST_WIDE_INT_1U << log;
break;
case alg_add_t2_m:
nmode = GET_MODE_INNER (mode);
val &= GET_MODE_MASK (nmode);
val_so_far &= GET_MODE_MASK (nmode);
- gcc_assert (val == val_so_far);
+ gcc_assert (val == (HOST_WIDE_INT) val_so_far);
return accum;
}