diff options
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/avr/avr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index f0def13ae8f..e83624087b2 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -7546,6 +7546,8 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen) // The smallest fractional bit not cleared by the rounding is 2^(-RP). int fbit = (int) GET_MODE_FBIT (mode); double_int i_add = double_int_zero.set_bit (fbit-1 - INTVAL (xop[2])); + wide_int wi_add = wi::set_bit_in_zero (fbit-1 - INTVAL (xop[2]), + GET_MODE_PRECISION (imode)); // Lengths of PLUS and AND parts. int len_add = 0, *plen_add = plen ? &len_add : NULL; int len_and = 0, *plen_and = plen ? &len_and : NULL; @@ -7575,7 +7577,7 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen) // Rounding point ^^^^^^^ // Added above ^^^^^^^^^ rtx xreg = simplify_gen_subreg (imode, xop[0], mode, 0); - rtx xmask = immed_double_int_const (-i_add - i_add, imode); + rtx xmask = immed_wide_int_const (-wi_add - wi_add, imode); xpattern = gen_rtx_SET (VOIDmode, xreg, gen_rtx_AND (imode, xreg, xmask)); @@ -12226,8 +12228,8 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, break; } - tmap = wide_int_to_tree (map_type, widest_int (arg[0])); - map = TREE_INT_CST_LOW (tmap); + tmap = wide_int_to_tree (map_type, arg[0]); + map = tree_to_uhwi (tmap); if (TREE_CODE (tval) != INTEGER_CST && 0 == avr_map_metric (map, MAP_MASK_PREIMAGE_F)) @@ -12331,8 +12333,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, /* Use map o G^-1 instead of original map to undo the effect of G. */ - tmap = wide_int_to_tree (map_type, - widest_int (best_g.map)); + tmap = wide_int_to_tree (map_type, best_g.map); return build_call_expr (fndecl, 3, tmap, tbits, tval); } /* AVR_BUILTIN_INSERT_BITS */ |