aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-09-09 13:06:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2013-09-09 13:06:53 +0000
commit2f1cd2ebd65eae6d87332c0bcd5d0e840c886cf3 (patch)
tree8a0c069c9c8784f5d1a4f0ad98b31f8275795896 /gcc/optabs.c
parent4789c0cef392722e1c084eba900c0c469fba3bc1 (diff)
downloadgcc-2f1cd2ebd65eae6d87332c0bcd5d0e840c886cf3.zip
gcc-2f1cd2ebd65eae6d87332c0bcd5d0e840c886cf3.tar.gz
gcc-2f1cd2ebd65eae6d87332c0bcd5d0e840c886cf3.tar.bz2
asan.c (asan_clear_shadow): Use gen_int_mode with the mode of the associated expand_* call.
gcc/ * asan.c (asan_clear_shadow): Use gen_int_mode with the mode of the associated expand_* call. (asan_emit_stack_protection): Likewise. * builtins.c (round_trampoline_addr): Likewise. * explow.c (allocate_dynamic_stack_space, probe_stack_range): Likewise. * expmed.c (expand_smod_pow2, expand_sdiv_pow2, expand_divmod) (emit_store_flag): Likewise. * expr.c (emit_move_resolve_push, push_block, emit_single_push_insn_1) (emit_push_insn, optimize_bitfield_assignment_op, expand_expr_real_1): Likewise. * function.c (instantiate_virtual_regs_in_insn): Likewise. * ifcvt.c (noce_try_store_flag_constants): Likewise. * loop-unroll.c (unroll_loop_runtime_iterations): Likewise. * modulo-sched.c (generate_prolog_epilog): Likewise. * optabs.c (expand_binop, widen_leading, expand_doubleword_clz) (expand_ctz, expand_ffs, expand_unop): Likewise. From-SVN: r202392
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index a3051ad..1d0659e 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -1563,7 +1563,7 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
newop1 = negate_rtx (GET_MODE (op1), op1);
else
newop1 = expand_binop (GET_MODE (op1), sub_optab,
- GEN_INT (bits), op1,
+ gen_int_mode (bits, GET_MODE (op1)), op1,
NULL_RTX, unsignedp, OPTAB_DIRECT);
temp = expand_binop_directly (mode, otheroptab, op0, newop1,
@@ -2539,10 +2539,12 @@ widen_leading (enum machine_mode mode, rtx op0, rtx target, optab unoptab)
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
unoptab != clrsb_optab);
if (temp != 0)
- temp = expand_binop (wider_mode, sub_optab, temp,
- GEN_INT (GET_MODE_PRECISION (wider_mode)
- - GET_MODE_PRECISION (mode)),
- target, true, OPTAB_DIRECT);
+ temp = expand_binop
+ (wider_mode, sub_optab, temp,
+ gen_int_mode (GET_MODE_PRECISION (wider_mode)
+ - GET_MODE_PRECISION (mode),
+ wider_mode),
+ target, true, OPTAB_DIRECT);
if (temp == 0)
delete_insns_since (last);
@@ -2601,7 +2603,7 @@ expand_doubleword_clz (enum machine_mode mode, rtx op0, rtx target)
if (!temp)
goto fail;
temp = expand_binop (word_mode, add_optab, temp,
- GEN_INT (GET_MODE_BITSIZE (word_mode)),
+ gen_int_mode (GET_MODE_BITSIZE (word_mode), word_mode),
result, true, OPTAB_DIRECT);
if (!temp)
goto fail;
@@ -2757,7 +2759,8 @@ expand_ctz (enum machine_mode mode, rtx op0, rtx target)
if (temp)
temp = expand_unop_direct (mode, clz_optab, temp, NULL_RTX, true);
if (temp)
- temp = expand_binop (mode, sub_optab, GEN_INT (GET_MODE_PRECISION (mode) - 1),
+ temp = expand_binop (mode, sub_optab,
+ gen_int_mode (GET_MODE_PRECISION (mode) - 1, mode),
temp, target,
true, OPTAB_DIRECT);
if (temp == 0)
@@ -2838,7 +2841,7 @@ expand_ffs (enum machine_mode mode, rtx op0, rtx target)
/* temp now has a value in the range -1..bitsize-1. ffs is supposed
to produce a value in the range 0..bitsize. */
- temp = expand_binop (mode, add_optab, temp, GEN_INT (1),
+ temp = expand_binop (mode, add_optab, temp, gen_int_mode (1, mode),
target, false, OPTAB_DIRECT);
if (!temp)
goto fail;
@@ -3308,10 +3311,12 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
result. Similarly for clrsb. */
if ((unoptab == clz_optab || unoptab == clrsb_optab)
&& temp != 0)
- temp = expand_binop (wider_mode, sub_optab, temp,
- GEN_INT (GET_MODE_PRECISION (wider_mode)
- - GET_MODE_PRECISION (mode)),
- target, true, OPTAB_DIRECT);
+ temp = expand_binop
+ (wider_mode, sub_optab, temp,
+ gen_int_mode (GET_MODE_PRECISION (wider_mode)
+ - GET_MODE_PRECISION (mode),
+ wider_mode),
+ target, true, OPTAB_DIRECT);
/* Likewise for bswap. */
if (unoptab == bswap_optab && temp != 0)