aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:18:59 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:18:59 +0000
commit095a2d76a26fa4ee17fa56bff21bf4f269db2368 (patch)
tree8ae047a4a1de314bb5626316e362e598a1fc4e2f /gcc/expr.c
parentd787ba568aa9bfa00c71f55b86ddb95a3d153db0 (diff)
downloadgcc-095a2d76a26fa4ee17fa56bff21bf4f269db2368.zip
gcc-095a2d76a26fa4ee17fa56bff21bf4f269db2368.tar.gz
gcc-095a2d76a26fa4ee17fa56bff21bf4f269db2368.tar.bz2
[62/77] Big machine_mode to scalar_int_mode replacement
This patch changes the types of various things from machine_mode to scalar_int_mode, in cases where (after previous patches) simply changing the type is enough on its own. The patch does nothing other than that. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * builtins.h (builtin_strncpy_read_str): Take a scalar_int_mode instead of a machine_mode. (builtin_memset_read_str): Likewise. * builtins.c (c_readstr): Likewise. (builtin_memcpy_read_str): Likewise. (builtin_strncpy_read_str): Likewise. (builtin_memset_read_str): Likewise. (builtin_memset_gen_str): Likewise. (expand_builtin_signbit): Use scalar_int_mode for local variables. * cfgexpand.c (convert_debug_memory_address): Take a scalar_int_mode instead of a machine_mode. * combine.c (simplify_if_then_else): Use scalar_int_mode for local variables. (make_extraction): Likewise. (try_widen_shift_mode): Take and return scalar_int_modes instead of machine_modes. * config/aarch64/aarch64.c (aarch64_libgcc_cmp_return_mode): Return a scalar_int_mode instead of a machine_mode. * config/avr/avr.c (avr_addr_space_address_mode): Likewise. (avr_addr_space_pointer_mode): Likewise. * config/cr16/cr16.c (cr16_unwind_word_mode): Likewise. * config/msp430/msp430.c (msp430_addr_space_pointer_mode): Likewise. (msp430_unwind_word_mode): Likewise. * config/spu/spu.c (spu_unwind_word_mode): Likewise. (spu_addr_space_pointer_mode): Likewise. (spu_addr_space_address_mode): Likewise. (spu_libgcc_cmp_return_mode): Likewise. (spu_libgcc_shift_count_mode): Likewise. * config/rl78/rl78.c (rl78_addr_space_address_mode): Likewise. (rl78_addr_space_pointer_mode): Likewise. (fl78_unwind_word_mode): Likewise. (rl78_valid_pointer_mode): Take a scalar_int_mode instead of a machine_mode. * config/alpha/alpha.c (vms_valid_pointer_mode): Likewise. * config/ia64/ia64.c (ia64_vms_valid_pointer_mode): Likewise. * config/mips/mips.c (mips_mode_rep_extended): Likewise. (mips_valid_pointer_mode): Likewise. * config/tilegx/tilegx.c (tilegx_mode_rep_extended): Likewise. * config/ft32/ft32.c (ft32_valid_pointer_mode): Likewise. (ft32_addr_space_pointer_mode): Return a scalar_int_mode instead of a machine_mode. (ft32_addr_space_address_mode): Likewise. * config/m32c/m32c.c (m32c_valid_pointer_mode): Take a scalar_int_mode instead of a machine_mode. (m32c_addr_space_pointer_mode): Return a scalar_int_mode instead of a machine_mode. (m32c_addr_space_address_mode): Likewise. * config/powerpcspe/powerpcspe.c (rs6000_abi_word_mode): Likewise. (rs6000_eh_return_filter_mode): Likewise. * config/rs6000/rs6000.c (rs6000_abi_word_mode): Likewise. (rs6000_eh_return_filter_mode): Likewise. * config/s390/s390.c (s390_libgcc_cmp_return_mode): Likewise. (s390_libgcc_shift_count_mode): Likewise. (s390_unwind_word_mode): Likewise. (s390_valid_pointer_mode): Take a scalar_int_mode rather than a machine_mode. * target.def (mode_rep_extended): Likewise. (valid_pointer_mode): Likewise. (addr_space.valid_pointer_mode): Likewise. (eh_return_filter_mode): Return a scalar_int_mode rather than a machine_mode. (libgcc_cmp_return_mode): Likewise. (libgcc_shift_count_mode): Likewise. (unwind_word_mode): Likewise. (addr_space.pointer_mode): Likewise. (addr_space.address_mode): Likewise. * doc/tm.texi: Regenerate. * dojump.c (prefer_and_bit_test): Take a scalar_int_mode rather than a machine_mode. (do_jump): Use scalar_int_mode for local variables. * dwarf2cfi.c (init_return_column_size): Take a scalar_int_mode rather than a machine_mode. * dwarf2out.c (convert_descriptor_to_mode): Likewise. (scompare_loc_descriptor_wide): Likewise. (scompare_loc_descriptor_narrow): Likewise. * emit-rtl.c (adjust_address_1): Use scalar_int_mode for local variables. * except.c (sjlj_emit_dispatch_table): Likewise. (expand_builtin_eh_copy_values): Likewise. * explow.c (convert_memory_address_addr_space_1): Likewise. Take a scalar_int_mode rather than a machine_mode. (convert_memory_address_addr_space): Take a scalar_int_mode rather than a machine_mode. (memory_address_addr_space): Use scalar_int_mode for local variables. * expmed.h (expand_mult_highpart_adjust): Take a scalar_int_mode rather than a machine_mode. * expmed.c (mask_rtx): Likewise. (init_expmed_one_conv): Likewise. (expand_mult_highpart_adjust): Likewise. (extract_high_half): Likewise. (expmed_mult_highpart_optab): Likewise. (expmed_mult_highpart): Likewise. (expand_smod_pow2): Likewise. (expand_sdiv_pow2): Likewise. (emit_store_flag_int): Likewise. (adjust_bit_field_mem_for_reg): Use scalar_int_mode for local variables. (extract_low_bits): Likewise. * expr.h (by_pieces_constfn): Take a scalar_int_mode rather than a machine_mode. * expr.c (pieces_addr::adjust): Likewise. (can_store_by_pieces): Likewise. (store_by_pieces): Likewise. (clear_by_pieces_1): Likewise. (expand_expr_addr_expr_1): Likewise. (expand_expr_addr_expr): Use scalar_int_mode for local variables. (expand_expr_real_1): Likewise. (try_casesi): Likewise. * final.c (shorten_branches): Likewise. * fold-const.c (fold_convert_const_int_from_fixed): Change the type of "mode" to machine_mode. * internal-fn.c (expand_arith_overflow_result_store): Take a scalar_int_mode rather than a machine_mode. (expand_mul_overflow): Use scalar_int_mode for local variables. * loop-doloop.c (doloop_modify): Likewise. (doloop_optimize): Likewise. * optabs.c (expand_subword_shift): Take a scalar_int_mode rather than a machine_mode. (expand_doubleword_shift_condmove): Likewise. (expand_doubleword_shift): Likewise. (expand_doubleword_clz): Likewise. (expand_doubleword_popcount): Likewise. (expand_doubleword_parity): Likewise. (expand_absneg_bit): Use scalar_int_mode for local variables. (prepare_float_lib_cmp): Likewise. * rtl.h (convert_memory_address_addr_space_1): Take a scalar_int_mode rather than a machine_mode. (convert_memory_address_addr_space): Likewise. (get_mode_bounds): Likewise. (get_address_mode): Return a scalar_int_mode rather than a machine_mode. * rtlanal.c (get_address_mode): Likewise. * stor-layout.c (get_mode_bounds): Take a scalar_int_mode rather than a machine_mode. * targhooks.c (default_mode_rep_extended): Likewise. (default_valid_pointer_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. (default_eh_return_filter_mode): Return a scalar_int_mode rather than a machine_mode. (default_libgcc_cmp_return_mode): Likewise. (default_libgcc_shift_count_mode): Likewise. (default_unwind_word_mode): Likewise. (default_addr_space_pointer_mode): Likewise. (default_addr_space_address_mode): Likewise. * targhooks.h (default_eh_return_filter_mode): Likewise. (default_libgcc_cmp_return_mode): Likewise. (default_libgcc_shift_count_mode): Likewise. (default_unwind_word_mode): Likewise. (default_addr_space_pointer_mode): Likewise. (default_addr_space_address_mode): Likewise. (default_mode_rep_extended): Take a scalar_int_mode rather than a machine_mode. (default_valid_pointer_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * tree-ssa-address.c (addr_for_mem_ref): Use scalar_int_mode for local variables. * tree-ssa-loop-ivopts.c (get_shiftadd_cost): Take a scalar_int_mode rather than a machine_mode. * tree-switch-conversion.c (array_value_type): Use scalar_int_mode for local variables. * tree-vrp.c (simplify_float_conversion_using_ranges): Likewise. * var-tracking.c (use_narrower_mode): Take a scalar_int_mode rather than a machine_mode. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251513
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 481ad64..fcad2e3 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -842,7 +842,7 @@ class pieces_addr
void *m_cfndata;
public:
pieces_addr (rtx, bool, by_pieces_constfn, void *);
- rtx adjust (machine_mode, HOST_WIDE_INT);
+ rtx adjust (scalar_int_mode, HOST_WIDE_INT);
void increment_address (HOST_WIDE_INT);
void maybe_predec (HOST_WIDE_INT);
void maybe_postinc (HOST_WIDE_INT);
@@ -944,7 +944,7 @@ pieces_addr::decide_autoinc (machine_mode ARG_UNUSED (mode), bool reverse,
but we still modify the MEM's properties. */
rtx
-pieces_addr::adjust (machine_mode mode, HOST_WIDE_INT offset)
+pieces_addr::adjust (scalar_int_mode mode, HOST_WIDE_INT offset)
{
if (m_constfn)
return m_constfn (m_cfndata, offset, mode);
@@ -1277,7 +1277,7 @@ store_by_pieces_d::finish_endp (int endp)
int
can_store_by_pieces (unsigned HOST_WIDE_INT len,
- rtx (*constfun) (void *, HOST_WIDE_INT, machine_mode),
+ rtx (*constfun) (void *, HOST_WIDE_INT, scalar_int_mode),
void *constfundata, unsigned int align, bool memsetp)
{
unsigned HOST_WIDE_INT l;
@@ -1356,7 +1356,7 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
rtx
store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
- rtx (*constfun) (void *, HOST_WIDE_INT, machine_mode),
+ rtx (*constfun) (void *, HOST_WIDE_INT, scalar_int_mode),
void *constfundata, unsigned int align, bool memsetp, int endp)
{
if (len == 0)
@@ -1383,7 +1383,7 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
Return const0_rtx unconditionally. */
static rtx
-clear_by_pieces_1 (void *, HOST_WIDE_INT, machine_mode)
+clear_by_pieces_1 (void *, HOST_WIDE_INT, scalar_int_mode)
{
return const0_rtx;
}
@@ -7706,7 +7706,7 @@ expand_expr_constant (tree exp, int defer, enum expand_modifier modifier)
The TARGET, TMODE and MODIFIER arguments are as for expand_expr. */
static rtx
-expand_expr_addr_expr_1 (tree exp, rtx target, machine_mode tmode,
+expand_expr_addr_expr_1 (tree exp, rtx target, scalar_int_mode tmode,
enum expand_modifier modifier, addr_space_t as)
{
rtx result, subtarget;
@@ -7891,8 +7891,8 @@ expand_expr_addr_expr (tree exp, rtx target, machine_mode tmode,
enum expand_modifier modifier)
{
addr_space_t as = ADDR_SPACE_GENERIC;
- machine_mode address_mode = Pmode;
- machine_mode pointer_mode = ptr_mode;
+ scalar_int_mode address_mode = Pmode;
+ scalar_int_mode pointer_mode = ptr_mode;
machine_mode rmode;
rtx result;
@@ -7910,9 +7910,9 @@ expand_expr_addr_expr (tree exp, rtx target, machine_mode tmode,
/* We can get called with some Weird Things if the user does silliness
like "(short) &a". In that case, convert_memory_address won't do
the right thing, so ignore the given target mode. */
- machine_mode new_tmode = (tmode == pointer_mode
- ? pointer_mode
- : address_mode);
+ scalar_int_mode new_tmode = (tmode == pointer_mode
+ ? pointer_mode
+ : address_mode);
result = expand_expr_addr_expr_1 (TREE_OPERAND (exp, 0), target,
new_tmode, modifier, as);
@@ -9999,7 +9999,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
/* Writing into CONST_DECL is always invalid, but handle it
gracefully. */
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
- machine_mode address_mode = targetm.addr_space.address_mode (as);
+ scalar_int_mode address_mode = targetm.addr_space.address_mode (as);
op0 = expand_expr_addr_expr_1 (exp, NULL_RTX, address_mode,
EXPAND_NORMAL, as);
op0 = memory_address_addr_space (mode, op0, as);
@@ -11538,7 +11538,7 @@ try_casesi (tree index_type, tree index_expr, tree minval, tree range,
profile_probability default_probability)
{
struct expand_operand ops[5];
- machine_mode index_mode = SImode;
+ scalar_int_mode index_mode = SImode;
rtx op1, op2, index;
if (! targetm.have_casesi ())