diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab6f6172252..e4f46793f1b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -21,6 +21,14 @@ * tree-ssa-pre.c (remove_dead_inserted_code): Likewise. * tree-ssa.c (kill_redundant_phi_nodes): Likewise. + * combine.c (simplify_and_const_int): Use gen_int_mode instead + of GEN_INT (trunc_int_for_mode (...)). + * loop-iv.c (iv_number_of_iterations): Likewise. + * postreload.c (reload_cse_move2add): Likewise. + * simplify-rtx.c (simplify_const_unary_operation, + simplify_const_binary_operation): Likewise. + * stor-layout.c (get_mode_bounds): Likewise. + 2005-03-05 Richard Sandiford * doc/invoke.texi: Document new MIPS -msym32 and -mno-sym32 options. diff --git a/gcc/combine.c b/gcc/combine.c index 5d34dfa83f5..48d7020641c 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -8095,7 +8095,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, /* If VAROP is a CONST_INT, then we need to apply the mask in CONSTOP to VAROP and return the new constant. */ if (GET_CODE (varop) == CONST_INT) - return GEN_INT (trunc_int_for_mode (INTVAL (varop) & constop, mode)); + return gen_int_mode (INTVAL (varop) & constop, mode); /* See what bits may be nonzero in VAROP. Unlike the general case of a call to nonzero_bits, here we don't care about bits outside diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 04f53b88d3e..99b43b74213 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -2369,8 +2369,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d)); inv = inverse (s, size); - inv = trunc_int_for_mode (inv, mode); - tmp = simplify_gen_binary (MULT, mode, tmp, GEN_INT (inv)); + tmp = simplify_gen_binary (MULT, mode, tmp, gen_int_mode (inv, mode)); desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound); } else diff --git a/gcc/postreload.c b/gcc/postreload.c index df10eb49425..1b98c287a97 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1244,10 +1244,8 @@ reload_cse_move2add (rtx first) if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0) { - rtx new_src = - GEN_INT (trunc_int_for_mode (INTVAL (src) - - reg_offset[regno], - GET_MODE (reg))); + rtx new_src = gen_int_mode (INTVAL (src) - reg_offset[regno], + GET_MODE (reg)); /* (set (reg) (plus (reg) (const_int 0))) is not canonical; use (set (reg) (reg)) instead. We don't delete this insn, nor do we convert it into a @@ -1284,9 +1282,8 @@ reload_cse_move2add (rtx first) { rtx narrow_reg = gen_rtx_REG (narrow_mode, REGNO (reg)); - rtx narrow_src = - GEN_INT (trunc_int_for_mode (INTVAL (src), - narrow_mode)); + rtx narrow_src = gen_int_mode (INTVAL (src), + narrow_mode); rtx new_set = gen_rtx_SET (VOIDmode, gen_rtx_STRICT_LOW_PART (VOIDmode, @@ -1335,10 +1332,10 @@ reload_cse_move2add (rtx first) HOST_WIDE_INT base_offset = reg_offset[REGNO (src)]; HOST_WIDE_INT regno_offset = reg_offset[regno]; rtx new_src = - GEN_INT (trunc_int_for_mode (added_offset - + base_offset - - regno_offset, - GET_MODE (reg))); + gen_int_mode (added_offset + + base_offset + - regno_offset, + GET_MODE (reg)); int success = 0; if (new_src == const0_rtx) diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index c6b0ec81279..8a1b9bb4805 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -829,9 +829,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode, gcc_unreachable (); } - val = trunc_int_for_mode (val, mode); - - return GEN_INT (val); + return gen_int_mode (val, mode); } /* We can do some operations on integer CONST_DOUBLEs. Also allow @@ -2491,8 +2489,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode, gcc_unreachable (); } - val = trunc_int_for_mode (val, mode); - return GEN_INT (val); + return gen_int_mode (val, mode); } return NULL_RTX; diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index ac7fb744f66..66395a9c86b 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2097,8 +2097,8 @@ get_mode_bounds (enum machine_mode mode, int sign, max_val = ((unsigned HOST_WIDE_INT) 1 << (size - 1) << 1) - 1; } - *mmin = GEN_INT (trunc_int_for_mode (min_val, target_mode)); - *mmax = GEN_INT (trunc_int_for_mode (max_val, target_mode)); + *mmin = gen_int_mode (min_val, target_mode); + *mmax = gen_int_mode (max_val, target_mode); } #include "gt-stor-layout.h"