summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-05 17:41:49 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-05 17:41:49 +0000
commit29c05e22902bbba7db08fa62c244b68172cc14a2 (patch)
treea9e29626a294417f7835ab23c14674d3ce69ce5d /gcc/config
parentbfff5bd71a8cc29d1147627c6c779bbc422c1e81 (diff)
downloadgcc-29c05e22902bbba7db08fa62c244b68172cc14a2.tar.gz
gcc/
* rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c73
-rw-r--r--gcc/config/alpha/alpha.h2
-rw-r--r--gcc/config/alpha/alpha.md14
-rw-r--r--gcc/config/alpha/vms.h2
-rw-r--r--gcc/config/arm/arm.c157
-rw-r--r--gcc/config/arm/arm.md15
-rw-r--r--gcc/config/avr/avr.c35
-rw-r--r--gcc/config/bfin/bfin.c15
-rw-r--r--gcc/config/bfin/bfin.h3
-rw-r--r--gcc/config/c6x/c6x.c6
-rw-r--r--gcc/config/cr16/cr16.c2
-rw-r--r--gcc/config/cr16/cr16.h2
-rw-r--r--gcc/config/cris/cris.c53
-rw-r--r--gcc/config/cris/cris.md8
-rw-r--r--gcc/config/darwin.c4
-rw-r--r--gcc/config/epiphany/epiphany.c38
-rw-r--r--gcc/config/epiphany/epiphany.md6
-rw-r--r--gcc/config/fr30/fr30.c3
-rw-r--r--gcc/config/frv/frv.c24
-rw-r--r--gcc/config/h8300/h8300.c19
-rw-r--r--gcc/config/i386/i386.c94
-rw-r--r--gcc/config/i386/i386.h5
-rw-r--r--gcc/config/i386/i386.md4
-rw-r--r--gcc/config/ia64/ia64.c14
-rw-r--r--gcc/config/iq2000/iq2000.c19
-rw-r--r--gcc/config/lm32/lm32.c2
-rw-r--r--gcc/config/m32c/m32c.c6
-rw-r--r--gcc/config/m32r/m32r.c11
-rw-r--r--gcc/config/m68k/linux.h3
-rw-r--r--gcc/config/m68k/m68k.c22
-rw-r--r--gcc/config/m68k/m68k.h7
-rw-r--r--gcc/config/m68k/m68k.md9
-rw-r--r--gcc/config/mcore/mcore.c9
-rw-r--r--gcc/config/mcore/mcore.md8
-rw-r--r--gcc/config/mep/mep.c20
-rw-r--r--gcc/config/microblaze/microblaze.c7
-rw-r--r--gcc/config/mips/mips.c45
-rw-r--r--gcc/config/mips/mips.md8
-rw-r--r--gcc/config/mmix/mmix.c27
-rw-r--r--gcc/config/mn10300/mn10300.c11
-rw-r--r--gcc/config/moxie/moxie.c4
-rw-r--r--gcc/config/moxie/moxie.h4
-rw-r--r--gcc/config/pa/pa.c50
-rw-r--r--gcc/config/pa/pa.md8
-rw-r--r--gcc/config/pdp11/pdp11.c4
-rw-r--r--gcc/config/picochip/picochip.c2
-rw-r--r--gcc/config/rs6000/rs6000.c43
-rw-r--r--gcc/config/rs6000/rs6000.h2
-rw-r--r--gcc/config/rx/rx.c8
-rw-r--r--gcc/config/s390/s390.c49
-rw-r--r--gcc/config/s390/s390.h5
-rw-r--r--gcc/config/s390/s390.md6
-rw-r--r--gcc/config/score/score.c6
-rw-r--r--gcc/config/sh/sh.c18
-rw-r--r--gcc/config/sh/sh.md12
-rw-r--r--gcc/config/sparc/sparc.c37
-rw-r--r--gcc/config/sparc/sparc.h9
-rw-r--r--gcc/config/sparc/sparc.md2
-rw-r--r--gcc/config/spu/spu.c16
-rw-r--r--gcc/config/spu/spu.h2
-rw-r--r--gcc/config/stormy16/stormy16.c8
-rw-r--r--gcc/config/tilegx/tilegx.c9
-rw-r--r--gcc/config/tilegx/tilegx.h3
-rw-r--r--gcc/config/tilepro/tilepro.c9
-rw-r--r--gcc/config/tilepro/tilepro.h3
-rw-r--r--gcc/config/v850/v850.c12
-rw-r--r--gcc/config/v850/v850.md14
-rw-r--r--gcc/config/vax/elf.h6
-rw-r--r--gcc/config/vax/vax.c18
-rw-r--r--gcc/config/vax/vax.h5
-rw-r--r--gcc/config/xtensa/xtensa.c8
71 files changed, 677 insertions, 517 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index c52fc503b56..174abc2f559 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -988,7 +988,7 @@ alpha_legitimize_address_1 (rtx x, rtx scratch, enum machine_mode mode)
(!can_create_pseudo_p () ? scratch : NULL_RTX),
1, OPTAB_LIB_WIDEN);
- return plus_constant (x, low);
+ return plus_constant (Pmode, x, low);
}
}
@@ -1388,7 +1388,7 @@ get_unaligned_address (rtx ref)
if (GET_CODE (base) == PLUS)
offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0);
- return plus_constant (base, offset);
+ return plus_constant (Pmode, base, offset);
}
/* Compute a value X, such that X & 7 == (ADDR + OFS) & 7.
@@ -3233,21 +3233,22 @@ alpha_expand_unaligned_load (rtx tgt, rtx mem, HOST_WIDE_INT size,
tmp = change_address (mem, DImode,
gen_rtx_AND (DImode,
- plus_constant (mema, ofs),
+ plus_constant (DImode, mema, ofs),
GEN_INT (-8)));
set_mem_alias_set (tmp, 0);
emit_move_insn (meml, tmp);
tmp = change_address (mem, DImode,
gen_rtx_AND (DImode,
- plus_constant (mema, ofs + size - 1),
+ plus_constant (DImode, mema,
+ ofs + size - 1),
GEN_INT (-8)));
set_mem_alias_set (tmp, 0);
emit_move_insn (memh, tmp);
if (sign && size == 2)
{
- emit_move_insn (addr, plus_constant (mema, ofs+2));
+ emit_move_insn (addr, plus_constant (Pmode, mema, ofs+2));
emit_insn (gen_extql (extl, meml, addr));
emit_insn (gen_extqh (exth, memh, addr));
@@ -3261,7 +3262,7 @@ alpha_expand_unaligned_load (rtx tgt, rtx mem, HOST_WIDE_INT size,
}
else
{
- emit_move_insn (addr, plus_constant (mema, ofs));
+ emit_move_insn (addr, plus_constant (Pmode, mema, ofs));
emit_insn (gen_extxl (extl, meml, GEN_INT (size*8), addr));
switch ((int) size)
{
@@ -3333,20 +3334,21 @@ alpha_expand_unaligned_store (rtx dst, rtx src,
meml = change_address (dst, DImode,
gen_rtx_AND (DImode,
- plus_constant (dsta, ofs),
+ plus_constant (DImode, dsta, ofs),
GEN_INT (-8)));
set_mem_alias_set (meml, 0);
memh = change_address (dst, DImode,
gen_rtx_AND (DImode,
- plus_constant (dsta, ofs + size - 1),
+ plus_constant (DImode, dsta,
+ ofs + size - 1),
GEN_INT (-8)));
set_mem_alias_set (memh, 0);
emit_move_insn (dsth, memh);
emit_move_insn (dstl, meml);
- addr = copy_addr_to_reg (plus_constant (dsta, ofs));
+ addr = copy_addr_to_reg (plus_constant (Pmode, dsta, ofs));
if (src != CONST0_RTX (GET_MODE (src)))
{
@@ -3436,7 +3438,7 @@ alpha_expand_unaligned_load_words (rtx *out_regs, rtx smem,
{
tmp = change_address (smem, DImode,
gen_rtx_AND (DImode,
- plus_constant (smema, 8*i),
+ plus_constant (DImode, smema, 8*i),
im8));
set_mem_alias_set (tmp, 0);
emit_move_insn (data_regs[i], tmp);
@@ -3444,7 +3446,8 @@ alpha_expand_unaligned_load_words (rtx *out_regs, rtx smem,
tmp = change_address (smem, DImode,
gen_rtx_AND (DImode,
- plus_constant (smema, 8*words - 1),
+ plus_constant (DImode, smema,
+ 8*words - 1),
im8));
set_mem_alias_set (tmp, 0);
emit_move_insn (data_regs[words], tmp);
@@ -3504,8 +3507,9 @@ alpha_expand_unaligned_store_words (rtx *data_regs, rtx dmem,
st_addr_2 = change_address (dmem, DImode,
gen_rtx_AND (DImode,
- plus_constant (dmema, words*8 - 1),
- im8));
+ plus_constant (DImode, dmema,
+ words*8 - 1),
+ im8));
set_mem_alias_set (st_addr_2, 0);
st_addr_1 = change_address (dmem, DImode,
@@ -3551,7 +3555,8 @@ alpha_expand_unaligned_store_words (rtx *data_regs, rtx dmem,
{
rtx tmp = change_address (dmem, DImode,
gen_rtx_AND (DImode,
- plus_constant (dmema, i*8),
+ plus_constant (DImode,
+ dmema, i*8),
im8));
set_mem_alias_set (tmp, 0);
emit_move_insn (tmp, data_regs ? ins_tmps[i-1] : const0_rtx);
@@ -3961,7 +3966,8 @@ alpha_expand_block_clear (rtx operands[])
rtx mem
= change_address (orig_dst, DImode,
gen_rtx_AND (DImode,
- plus_constant (orig_dsta, ofs + i*8),
+ plus_constant (DImode, orig_dsta,
+ ofs + i*8),
GEN_INT (-8)));
set_mem_alias_set (mem, 0);
emit_move_insn (mem, const0_rtx);
@@ -4718,8 +4724,8 @@ alpha_init_machine_status (void)
void
alpha_expand_builtin_establish_vms_condition_handler (rtx target, rtx handler)
{
- rtx handler_slot_address
- = plus_constant (hard_frame_pointer_rtx, VMS_COND_HANDLER_FP_OFFSET);
+ rtx handler_slot_address = plus_constant (Pmode, hard_frame_pointer_rtx,
+ VMS_COND_HANDLER_FP_OFFSET);
rtx handler_slot
= gen_rtx_MEM (DImode, handler_slot_address);
@@ -6055,7 +6061,7 @@ alpha_setup_incoming_varargs (cumulative_args_t pcum, enum machine_mode mode,
if (cfun->va_list_fpr_size & 1)
{
tmp = gen_rtx_MEM (BLKmode,
- plus_constant (virtual_incoming_args_rtx,
+ plus_constant (Pmode, virtual_incoming_args_rtx,
(cum + 6) * UNITS_PER_WORD));
MEM_NOTRAP_P (tmp) = 1;
set_mem_alias_set (tmp, set);
@@ -6065,7 +6071,7 @@ alpha_setup_incoming_varargs (cumulative_args_t pcum, enum machine_mode mode,
if (cfun->va_list_fpr_size & 2)
{
tmp = gen_rtx_MEM (BLKmode,
- plus_constant (virtual_incoming_args_rtx,
+ plus_constant (Pmode, virtual_incoming_args_rtx,
cum * UNITS_PER_WORD));
MEM_NOTRAP_P (tmp) = 1;
set_mem_alias_set (tmp, set);
@@ -7514,7 +7520,7 @@ emit_frame_store_1 (rtx value, rtx base_reg, HOST_WIDE_INT frame_bias,
{
rtx addr, mem, insn;
- addr = plus_constant (base_reg, base_ofs);
+ addr = plus_constant (Pmode, base_reg, base_ofs);
mem = gen_frame_mem (DImode, addr);
insn = emit_move_insn (mem, value);
@@ -7524,7 +7530,8 @@ emit_frame_store_1 (rtx value, rtx base_reg, HOST_WIDE_INT frame_bias,
{
if (frame_bias)
{
- addr = plus_constant (stack_pointer_rtx, frame_bias + base_ofs);
+ addr = plus_constant (Pmode, stack_pointer_rtx,
+ frame_bias + base_ofs);
mem = gen_rtx_MEM (DImode, addr);
}
@@ -7679,7 +7686,8 @@ alpha_expand_prologue (void)
if ((leftover > 4096 && sa_size == 0) || flag_stack_check)
{
- rtx last = gen_rtx_MEM (DImode, plus_constant (ptr, -leftover));
+ rtx last = gen_rtx_MEM (DImode,
+ plus_constant (Pmode, ptr, -leftover));
MEM_VOLATILE_P (last) = 1;
emit_move_insn (last, const0_rtx);
}
@@ -7710,7 +7718,7 @@ alpha_expand_prologue (void)
RTX_FRAME_RELATED_P (seq) = 1;
add_reg_note (seq, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-frame_size)));
}
@@ -7791,7 +7799,7 @@ alpha_expand_prologue (void)
rtx seq
= emit_move_insn (stack_pointer_rtx,
plus_constant
- (hard_frame_pointer_rtx,
+ (Pmode, hard_frame_pointer_rtx,
- (ALPHA_ROUND
(crtl->outgoing_args_size))));
@@ -8087,14 +8095,14 @@ alpha_expand_epilogue (void)
bias = reg_offset, reg_offset = 0;
sa_reg = gen_rtx_REG (DImode, 22);
- sa_reg_exp = plus_constant (stack_pointer_rtx, bias);
+ sa_reg_exp = plus_constant (Pmode, stack_pointer_rtx, bias);
emit_move_insn (sa_reg, sa_reg_exp);
}
/* Restore registers in order, excepting a true frame pointer. */
- mem = gen_frame_mem (DImode, plus_constant (sa_reg, reg_offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode, sa_reg, reg_offset));
reg = gen_rtx_REG (DImode, REG_RA);
emit_move_insn (reg, mem);
cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores);
@@ -8110,7 +8118,8 @@ alpha_expand_epilogue (void)
else
{
mem = gen_frame_mem (DImode,
- plus_constant (sa_reg, reg_offset));
+ plus_constant (Pmode, sa_reg,
+ reg_offset));
reg = gen_rtx_REG (DImode, i);
emit_move_insn (reg, mem);
cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg,
@@ -8122,7 +8131,8 @@ alpha_expand_epilogue (void)
for (i = 0; i < 31; ++i)
if (fmask & (1UL << i))
{
- mem = gen_frame_mem (DFmode, plus_constant (sa_reg, reg_offset));
+ mem = gen_frame_mem (DFmode, plus_constant (Pmode, sa_reg,
+ reg_offset));
reg = gen_rtx_REG (DFmode, i+32);
emit_move_insn (reg, mem);
cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores);
@@ -8150,7 +8160,7 @@ alpha_expand_epilogue (void)
{
int low = ((frame_size & 0xffff) ^ 0x8000) - 0x8000;
- sp_adj2 = plus_constant (sp_adj1, frame_size - low);
+ sp_adj2 = plus_constant (Pmode, sp_adj1, frame_size - low);
if (sa_reg_exp && rtx_equal_p (sa_reg_exp, sp_adj2))
sp_adj1 = sa_reg;
else
@@ -8180,7 +8190,8 @@ alpha_expand_epilogue (void)
if (fp_is_frame_pointer)
{
emit_insn (gen_blockage ());
- mem = gen_frame_mem (DImode, plus_constant (sa_reg, fp_offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode, sa_reg,
+ fp_offset));
emit_move_insn (hard_frame_pointer_rtx, mem);
cfa_restores = alloc_reg_note (REG_CFA_RESTORE,
hard_frame_pointer_rtx, cfa_restores);
@@ -9509,7 +9520,7 @@ alpha_use_linkage (rtx func, bool lflag, bool rflag)
al->rkind = rflag ? KIND_CODEADDR : KIND_LINKAGE;
if (lflag)
- return gen_rtx_MEM (Pmode, plus_constant (al->linkage, 8));
+ return gen_rtx_MEM (Pmode, plus_constant (Pmode, al->linkage, 8));
else
return al->linkage;
}
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 194e9a257e5..8520ea82f45 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -767,7 +767,7 @@ extern int alpha_memory_latency;
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM)
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 28)
#define EH_RETURN_HANDLER_RTX \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \
+ gen_rtx_MEM (Pmode, plus_constant (Pmode, stack_pointer_rtx, \
crtl->outgoing_args_size))
/* Addressing modes, and classification of registers for them. */
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index d090634bb4d..e89ed271942 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -1666,7 +1666,7 @@
;; (match_dup 4)))]
;; "
;;{
-;; operands[6] = plus_constant (operands[3],
+;; operands[6] = plus_constant (DImode, operands[3],
;; INTVAL (operands[2]) / BITS_PER_UNIT);
;; operands[7] = GEN_INT (- INTVAL (operands[2]) / BITS_PER_UNIT);
;;}")
@@ -3971,7 +3971,8 @@
else
{
emit_move_insn (gen_rtx_REG (Pmode, 26),
- gen_rtx_MEM (Pmode, plus_constant (operands[0], 8)));
+ gen_rtx_MEM (Pmode, plus_constant (Pmode,
+ operands[0], 8)));
operands[2] = operands[0];
}
@@ -4046,7 +4047,8 @@
else
{
emit_move_insn (gen_rtx_REG (Pmode, 26),
- gen_rtx_MEM (Pmode, plus_constant (operands[1], 8)));
+ gen_rtx_MEM (Pmode, plus_constant (Pmode,
+ operands[1], 8)));
operands[3] = operands[1];
}
})
@@ -5572,7 +5574,7 @@
[(set (match_dup 1) (match_operand:DI 0 "const_int_operand" ""))]
""
{
- operands[1] = gen_rtx_MEM (DImode, plus_constant (stack_pointer_rtx,
+ operands[1] = gen_rtx_MEM (DImode, plus_constant (Pmode, stack_pointer_rtx,
INTVAL (operands[0])));
MEM_VOLATILE_P (operands[1]) = 1;
@@ -5794,8 +5796,8 @@
{
/* The elements of the buffer are, in order: */
rtx fp = gen_rtx_MEM (Pmode, operands[0]);
- rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], 8));
- rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 16));
+ rtx lab = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0], 8));
+ rtx stack = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0], 16));
rtx pv = gen_rtx_REG (Pmode, 27);
/* This bit is the same as expand_builtin_longjmp. */
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 73e45a5f85c..6f90122fef3 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -206,7 +206,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef EH_RETURN_HANDLER_RTX
#define EH_RETURN_HANDLER_RTX \
- gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, 8))
+ gen_rtx_MEM (Pmode, plus_constant (Pmode, stack_pointer_rtx, 8))
#define LINK_EH_SPEC "vms-dwarf2eh.o%s "
#define LINK_GCC_C_SEQUENCE_SPEC "%G"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 4d11d7e5e36..17b4b5d43de 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2226,7 +2226,7 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
a_tramp = XEXP (m_tramp, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
LCT_NORMAL, VOIDmode, 2, a_tramp, Pmode,
- plus_constant (a_tramp, TRAMPOLINE_SIZE), Pmode);
+ plus_constant (Pmode, a_tramp, TRAMPOLINE_SIZE), Pmode);
}
/* Thumb trampolines should be entered in thumb mode, so set
@@ -5458,7 +5458,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
}
if (GET_CODE (offset) == CONST_INT)
- return plus_constant (base, INTVAL (offset));
+ return plus_constant (Pmode, base, INTVAL (offset));
}
if (GET_MODE_SIZE (mode) > 4
@@ -5575,7 +5575,7 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
/* On the ARM the PC register contains 'dot + 8' at the time of the
addition, on the Thumb it is 'dot + 4'. */
- pic_rtx = plus_constant (l1, TARGET_ARM ? 8 : 4);
+ pic_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4);
pic_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, pic_rtx),
UNSPEC_GOTSYM_OFF);
pic_rtx = gen_rtx_CONST (Pmode, pic_rtx);
@@ -5623,7 +5623,7 @@ arm_pic_static_addr (rtx orig, rtx reg)
/* On the ARM the PC register contains 'dot + 8' at the time of the
addition, on the Thumb it is 'dot + 4'. */
- offset_rtx = plus_constant (l1, TARGET_ARM ? 8 : 4);
+ offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4);
offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx),
UNSPEC_SYMBOL_OFFSET);
offset_rtx = gen_rtx_CONST (Pmode, offset_rtx);
@@ -6513,9 +6513,9 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
}
base_reg = gen_reg_rtx (SImode);
- val = force_operand (plus_constant (xop0, n), NULL_RTX);
+ val = force_operand (plus_constant (Pmode, xop0, n), NULL_RTX);
emit_move_insn (base_reg, val);
- x = plus_constant (base_reg, low_n);
+ x = plus_constant (Pmode, base_reg, low_n);
}
else if (xop0 != XEXP (x, 0) || xop1 != XEXP (x, 1))
x = gen_rtx_PLUS (SImode, xop0, xop1);
@@ -6563,7 +6563,7 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
index -= mask;
}
base_reg = force_reg (SImode, GEN_INT (base));
- x = plus_constant (base_reg, index);
+ x = plus_constant (Pmode, base_reg, index);
}
if (flag_pic)
@@ -6612,9 +6612,9 @@ thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
else
delta = offset & (~31 * GET_MODE_SIZE (mode));
- xop0 = force_operand (plus_constant (xop0, offset - delta),
+ xop0 = force_operand (plus_constant (Pmode, xop0, offset - delta),
NULL_RTX);
- x = plus_constant (xop0, delta);
+ x = plus_constant (Pmode, xop0, delta);
}
else if (offset < 0 && offset > -256)
/* Small negative offsets are best done with a subtract before the
@@ -10781,7 +10781,7 @@ arm_gen_load_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
emit_move_insn (gen_rtx_REG (SImode, regs[i]), mems[i]);
if (wback_offset != 0)
- emit_move_insn (basereg, plus_constant (basereg, wback_offset));
+ emit_move_insn (basereg, plus_constant (Pmode, basereg, wback_offset));
seq = get_insns ();
end_sequence ();
@@ -10795,7 +10795,7 @@ arm_gen_load_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
{
XVECEXP (result, 0, 0)
= gen_rtx_SET (VOIDmode, basereg,
- plus_constant (basereg, wback_offset));
+ plus_constant (Pmode, basereg, wback_offset));
i = 1;
count++;
}
@@ -10833,7 +10833,7 @@ arm_gen_store_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
emit_move_insn (mems[i], gen_rtx_REG (SImode, regs[i]));
if (wback_offset != 0)
- emit_move_insn (basereg, plus_constant (basereg, wback_offset));
+ emit_move_insn (basereg, plus_constant (Pmode, basereg, wback_offset));
seq = get_insns ();
end_sequence ();
@@ -10847,7 +10847,7 @@ arm_gen_store_multiple_1 (int count, int *regs, rtx *mems, rtx basereg,
{
XVECEXP (result, 0, 0)
= gen_rtx_SET (VOIDmode, basereg,
- plus_constant (basereg, wback_offset));
+ plus_constant (Pmode, basereg, wback_offset));
i = 1;
count++;
}
@@ -10889,7 +10889,7 @@ arm_gen_multiple_op (bool is_load, int *regs, int count, rtx basereg,
for (i = 0; i < count; i++)
{
- rtx addr = plus_constant (basereg, i * 4);
+ rtx addr = plus_constant (Pmode, basereg, i * 4);
mems[i] = adjust_automodify_address_nv (basemem, SImode, addr, offset);
offset += 4;
}
@@ -10978,7 +10978,7 @@ gen_ldm_seq (rtx *operands, int nops, bool sort_regs)
for (i = 0; i < nops; i++)
{
- addr = plus_constant (base_reg_rtx, offset + i * 4);
+ addr = plus_constant (Pmode, base_reg_rtx, offset + i * 4);
mems[i] = adjust_automodify_address_nv (operands[nops + mem_order[i]],
SImode, addr, 0);
}
@@ -11028,11 +11028,11 @@ gen_stm_seq (rtx *operands, int nops)
offset = 0;
}
- addr = plus_constant (base_reg_rtx, offset);
+ addr = plus_constant (Pmode, base_reg_rtx, offset);
for (i = 0; i < nops; i++)
{
- addr = plus_constant (base_reg_rtx, offset + i * 4);
+ addr = plus_constant (Pmode, base_reg_rtx, offset + i * 4);
mems[i] = adjust_automodify_address_nv (operands[nops + mem_order[i]],
SImode, addr, 0);
}
@@ -11144,11 +11144,11 @@ gen_const_stm_seq (rtx *operands, int nops)
offset = 0;
}
- addr = plus_constant (base_reg_rtx, offset);
+ addr = plus_constant (Pmode, base_reg_rtx, offset);
for (i = 0; i < nops; i++)
{
- addr = plus_constant (base_reg_rtx, offset + i * 4);
+ addr = plus_constant (Pmode, base_reg_rtx, offset + i * 4);
mems[i] = adjust_automodify_address_nv (operands[nops + mem_order[i]],
SImode, addr, 0);
}
@@ -11220,8 +11220,8 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
for (j = 0; j < interleave_factor; j++)
{
- addr = plus_constant (src, srcoffset + j * UNITS_PER_WORD
- - src_autoinc);
+ addr = plus_constant (Pmode, src, (srcoffset + j * UNITS_PER_WORD
+ - src_autoinc));
mem = adjust_automodify_address (srcbase, SImode, addr,
srcoffset + j * UNITS_PER_WORD);
emit_insn (gen_unaligned_loadsi (regs[j], mem));
@@ -11240,8 +11240,8 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
for (j = 0; j < interleave_factor; j++)
{
- addr = plus_constant (dst, dstoffset + j * UNITS_PER_WORD
- - dst_autoinc);
+ addr = plus_constant (Pmode, dst, (dstoffset + j * UNITS_PER_WORD
+ - dst_autoinc));
mem = adjust_automodify_address (dstbase, SImode, addr,
dstoffset + j * UNITS_PER_WORD);
emit_insn (gen_unaligned_storesi (mem, regs[j]));
@@ -11269,7 +11269,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
for (j = 0; j < words; j++)
{
- addr = plus_constant (src,
+ addr = plus_constant (Pmode, src,
srcoffset + j * UNITS_PER_WORD - src_autoinc);
mem = adjust_automodify_address (srcbase, SImode, addr,
srcoffset + j * UNITS_PER_WORD);
@@ -11288,7 +11288,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
for (j = 0; j < words; j++)
{
- addr = plus_constant (dst,
+ addr = plus_constant (Pmode, dst,
dstoffset + j * UNITS_PER_WORD - dst_autoinc);
mem = adjust_automodify_address (dstbase, SImode, addr,
dstoffset + j * UNITS_PER_WORD);
@@ -11307,7 +11307,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
halfword_tmp = gen_reg_rtx (SImode);
- addr = plus_constant (src, srcoffset - src_autoinc);
+ addr = plus_constant (Pmode, src, srcoffset - src_autoinc);
mem = adjust_automodify_address (srcbase, HImode, addr, srcoffset);
emit_insn (gen_unaligned_loadhiu (halfword_tmp, mem));
@@ -11315,7 +11315,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
byte, depending on interleave factor. */
if (interleave_factor == 1)
{
- addr = plus_constant (dst, dstoffset - dst_autoinc);
+ addr = plus_constant (Pmode, dst, dstoffset - dst_autoinc);
mem = adjust_automodify_address (dstbase, HImode, addr, dstoffset);
emit_insn (gen_unaligned_storehi (mem,
gen_lowpart (HImode, halfword_tmp)));
@@ -11335,13 +11335,13 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
{
byte_tmp = gen_reg_rtx (SImode);
- addr = plus_constant (src, srcoffset - src_autoinc);
+ addr = plus_constant (Pmode, src, srcoffset - src_autoinc);
mem = adjust_automodify_address (srcbase, QImode, addr, srcoffset);
emit_move_insn (gen_lowpart (QImode, byte_tmp), mem);
if (interleave_factor == 1)
{
- addr = plus_constant (dst, dstoffset - dst_autoinc);
+ addr = plus_constant (Pmode, dst, dstoffset - dst_autoinc);
mem = adjust_automodify_address (dstbase, QImode, addr, dstoffset);
emit_move_insn (mem, gen_lowpart (QImode, byte_tmp));
byte_tmp = NULL;
@@ -11356,7 +11356,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
if (halfword_tmp)
{
- addr = plus_constant (dst, dstoffset - dst_autoinc);
+ addr = plus_constant (Pmode, dst, dstoffset - dst_autoinc);
mem = adjust_automodify_address (dstbase, HImode, addr, dstoffset);
emit_insn (gen_unaligned_storehi (mem,
gen_lowpart (HImode, halfword_tmp)));
@@ -11367,7 +11367,7 @@ arm_block_move_unaligned_straight (rtx dstbase, rtx srcbase,
if (byte_tmp)
{
- addr = plus_constant (dst, dstoffset - dst_autoinc);
+ addr = plus_constant (Pmode, dst, dstoffset - dst_autoinc);
mem = adjust_automodify_address (dstbase, QImode, addr, dstoffset);
emit_move_insn (mem, gen_lowpart (QImode, byte_tmp));
dstoffset++;
@@ -11433,8 +11433,8 @@ arm_block_move_unaligned_loop (rtx dest, rtx src, HOST_WIDE_INT length,
interleave_factor);
/* Move on to the next block. */
- emit_move_insn (src_reg, plus_constant (src_reg, bytes_per_iter));
- emit_move_insn (dest_reg, plus_constant (dest_reg, bytes_per_iter));
+ emit_move_insn (src_reg, plus_constant (Pmode, src_reg, bytes_per_iter));
+ emit_move_insn (dest_reg, plus_constant (Pmode, dest_reg, bytes_per_iter));
/* Emit the loop condition. */
test = gen_rtx_NE (VOIDmode, src_reg, final_src);
@@ -11595,7 +11595,8 @@ arm_gen_movmemqi (rtx *operands)
while (last_bytes)
{
mem = adjust_automodify_address (dstbase, QImode,
- plus_constant (dst, last_bytes - 1),
+ plus_constant (Pmode, dst,
+ last_bytes - 1),
dstoffset + last_bytes - 1);
emit_move_insn (mem, gen_lowpart (QImode, part_bytes_reg));
@@ -12120,11 +12121,11 @@ arm_reload_in_hi (rtx *operands)
emit_insn (gen_zero_extendqisi2 (scratch,
gen_rtx_MEM (QImode,
- plus_constant (base,
+ plus_constant (Pmode, base,
offset))));
emit_insn (gen_zero_extendqisi2 (gen_rtx_SUBREG (SImode, operands[0], 0),
gen_rtx_MEM (QImode,
- plus_constant (base,
+ plus_constant (Pmode, base,
offset + 1))));
if (!BYTES_BIG_ENDIAN)
emit_set_insn (gen_rtx_SUBREG (SImode, operands[0], 0),
@@ -12284,23 +12285,27 @@ arm_reload_out_hi (rtx *operands)
if (BYTES_BIG_ENDIAN)
{
emit_insn (gen_movqi (gen_rtx_MEM (QImode,
- plus_constant (base, offset + 1)),
+ plus_constant (Pmode, base,
+ offset + 1)),
gen_lowpart (QImode, outval)));
emit_insn (gen_lshrsi3 (scratch,
gen_rtx_SUBREG (SImode, outval, 0),
GEN_INT (8)));
- emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (base, offset)),
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (Pmode, base,
+ offset)),
gen_lowpart (QImode, scratch)));
}
else
{
- emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (base, offset)),
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (Pmode, base,
+ offset)),
gen_lowpart (QImode, outval)));
emit_insn (gen_lshrsi3 (scratch,
gen_rtx_SUBREG (SImode, outval, 0),
GEN_INT (8)));
emit_insn (gen_movqi (gen_rtx_MEM (QImode,
- plus_constant (base, offset + 1)),
+ plus_constant (Pmode, base,
+ offset + 1)),
gen_lowpart (QImode, scratch)));
}
}
@@ -13814,7 +13819,8 @@ arm_reorg (void)
if (GET_CODE (this_fix->insn) != BARRIER)
{
rtx addr
- = plus_constant (gen_rtx_LABEL_REF (VOIDmode,
+ = plus_constant (Pmode,
+ gen_rtx_LABEL_REF (VOIDmode,
minipool_vector_label),
this_fix->minipool->offset);
*this_fix->loc = gen_rtx_MEM (this_fix->mode, addr);
@@ -14025,7 +14031,7 @@ vfp_emit_fstmd (int base_reg, int count)
gen_rtx_PRE_MODIFY (Pmode,
stack_pointer_rtx,
plus_constant
- (stack_pointer_rtx,
+ (Pmode, stack_pointer_rtx,
- (count * 8)))
),
gen_rtx_UNSPEC (BLKmode,
@@ -14033,7 +14039,7 @@ vfp_emit_fstmd (int base_reg, int count)
UNSPEC_PUSH_MULT));
tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -(count * 8)));
+ plus_constant (Pmode, stack_pointer_rtx, -(count * 8)));
RTX_FRAME_RELATED_P (tmp) = 1;
XVECEXP (dwarf, 0, 0) = tmp;
@@ -14051,7 +14057,8 @@ vfp_emit_fstmd (int base_reg, int count)
tmp = gen_rtx_SET (VOIDmode,
gen_frame_mem (DFmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
i * 8)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
@@ -16538,7 +16545,7 @@ emit_multi_reg_push (unsigned long mask)
gen_rtx_PRE_MODIFY (Pmode,
stack_pointer_rtx,
plus_constant
- (stack_pointer_rtx,
+ (Pmode, stack_pointer_rtx,
-4 * num_regs))
),
gen_rtx_UNSPEC (BLKmode,
@@ -16573,7 +16580,7 @@ emit_multi_reg_push (unsigned long mask)
= gen_rtx_SET (VOIDmode,
gen_frame_mem
(SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
4 * j)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
@@ -16588,7 +16595,7 @@ emit_multi_reg_push (unsigned long mask)
tmp = gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -4 * num_regs));
+ plus_constant (Pmode, stack_pointer_rtx, -4 * num_regs));
RTX_FRAME_RELATED_P (tmp) = 1;
XVECEXP (dwarf, 0, 0) = tmp;
@@ -16631,7 +16638,7 @@ emit_sfm (int base_reg, int count)
gen_rtx_PRE_MODIFY (Pmode,
stack_pointer_rtx,
plus_constant
- (stack_pointer_rtx,
+ (Pmode, stack_pointer_rtx,
-12 * count))
),
gen_rtx_UNSPEC (BLKmode,
@@ -16649,7 +16656,8 @@ emit_sfm (int base_reg, int count)
tmp = gen_rtx_SET (VOIDmode,
gen_frame_mem (XFmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
i * 12)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
@@ -16658,7 +16666,7 @@ emit_sfm (int base_reg, int count)
tmp = gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -12 * count));
+ plus_constant (Pmode, stack_pointer_rtx, -12 * count));
RTX_FRAME_RELATED_P (tmp) = 1;
XVECEXP (dwarf, 0, 0) = tmp;
@@ -17130,7 +17138,7 @@ thumb_set_frame_pointer (arm_stack_offsets *offsets)
stack_pointer_rtx));
}
dwarf = gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
- plus_constant (stack_pointer_rtx, amount));
+ plus_constant (Pmode, stack_pointer_rtx, amount));
RTX_FRAME_RELATED_P (dwarf) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
}
@@ -17261,7 +17269,7 @@ arm_expand_prologue (void)
/* Just tell the dwarf backend that we adjusted SP. */
dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-fp_offset));
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
@@ -17289,7 +17297,8 @@ arm_expand_prologue (void)
}
insn = emit_set_insn (ip_rtx,
- plus_constant (stack_pointer_rtx, fp_offset));
+ plus_constant (Pmode, stack_pointer_rtx,
+ fp_offset));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -17318,7 +17327,7 @@ arm_expand_prologue (void)
{
rtx lr = gen_rtx_REG (SImode, LR_REGNUM);
- emit_set_insn (lr, plus_constant (lr, -4));
+ emit_set_insn (lr, plus_constant (SImode, lr, -4));
}
if (live_regs_mask)
@@ -17368,7 +17377,7 @@ arm_expand_prologue (void)
insn = gen_rtx_REG (SImode, 3);
else /* if (crtl->args.pretend_args_size == 0) */
{
- insn = plus_constant (hard_frame_pointer_rtx, 4);
+ insn = plus_constant (Pmode, hard_frame_pointer_rtx, 4);
insn = gen_frame_mem (SImode, insn);
}
emit_set_insn (ip_rtx, insn);
@@ -21595,7 +21604,7 @@ thumb1_emit_multi_reg_push (unsigned long mask, unsigned long real_regs)
par[i] = tmp;
}
- tmp = plus_constant (stack_pointer_rtx, -4 * i);
+ tmp = plus_constant (Pmode, stack_pointer_rtx, -4 * i);
tmp = gen_rtx_PRE_MODIFY (Pmode, stack_pointer_rtx, tmp);
tmp = gen_frame_mem (BLKmode, tmp);
tmp = gen_rtx_SET (VOIDmode, tmp, par[0]);
@@ -21605,7 +21614,7 @@ thumb1_emit_multi_reg_push (unsigned long mask, unsigned long real_regs)
insn = emit_insn (tmp);
/* Always build the stack adjustment note for unwind info. */
- tmp = plus_constant (stack_pointer_rtx, -4 * i);
+ tmp = plus_constant (Pmode, stack_pointer_rtx, -4 * i);
tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx, tmp);
par[0] = tmp;
@@ -21615,7 +21624,7 @@ thumb1_emit_multi_reg_push (unsigned long mask, unsigned long real_regs)
regno = ctz_hwi (real_regs);
reg = gen_rtx_REG (SImode, regno);
- tmp = plus_constant (stack_pointer_rtx, j * 4);
+ tmp = plus_constant (Pmode, stack_pointer_rtx, j * 4);
tmp = gen_frame_mem (SImode, tmp);
tmp = gen_rtx_SET (VOIDmode, tmp, reg);
RTX_FRAME_RELATED_P (tmp) = 1;
@@ -22559,7 +22568,7 @@ thumb1_expand_prologue (void)
x = GEN_INT (offset + 16 + crtl->args.pretend_args_size);
emit_insn (gen_addsi3 (work_reg, stack_pointer_rtx, x));
- x = plus_constant (stack_pointer_rtx, offset + 4);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset + 4);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
@@ -22573,13 +22582,13 @@ thumb1_expand_prologue (void)
x = gen_rtx_REG (SImode, PC_REGNUM);
emit_move_insn (work_reg, x);
- x = plus_constant (stack_pointer_rtx, offset + 12);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset + 12);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
emit_move_insn (work_reg, arm_hfp_rtx);
- x = plus_constant (stack_pointer_rtx, offset);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
}
@@ -22587,14 +22596,14 @@ thumb1_expand_prologue (void)
{
emit_move_insn (work_reg, arm_hfp_rtx);
- x = plus_constant (stack_pointer_rtx, offset);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
x = gen_rtx_REG (SImode, PC_REGNUM);
emit_move_insn (work_reg, x);
- x = plus_constant (stack_pointer_rtx, offset + 12);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset + 12);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
}
@@ -22602,7 +22611,7 @@ thumb1_expand_prologue (void)
x = gen_rtx_REG (SImode, LR_REGNUM);
emit_move_insn (work_reg, x);
- x = plus_constant (stack_pointer_rtx, offset + 8);
+ x = plus_constant (Pmode, stack_pointer_rtx, offset + 8);
x = gen_frame_mem (SImode, x);
emit_move_insn (x, work_reg);
@@ -22736,7 +22745,7 @@ thumb1_expand_prologue (void)
stack_pointer_rtx, reg));
dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-amount));
add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -23087,8 +23096,10 @@ thumb_expand_movmemqi (rtx *operands)
{
rtx reg = gen_reg_rtx (HImode);
emit_insn (gen_movhi (reg, gen_rtx_MEM (HImode,
- plus_constant (in, offset))));
- emit_insn (gen_movhi (gen_rtx_MEM (HImode, plus_constant (out, offset)),
+ plus_constant (Pmode, in,
+ offset))));
+ emit_insn (gen_movhi (gen_rtx_MEM (HImode, plus_constant (Pmode, out,
+ offset)),
reg));
len -= 2;
offset += 2;
@@ -23098,8 +23109,10 @@ thumb_expand_movmemqi (rtx *operands)
{
rtx reg = gen_reg_rtx (QImode);
emit_insn (gen_movqi (reg, gen_rtx_MEM (QImode,
- plus_constant (in, offset))));
- emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (out, offset)),
+ plus_constant (Pmode, in,
+ offset))));
+ emit_insn (gen_movqi (gen_rtx_MEM (QImode, plus_constant (Pmode, out,
+ offset)),
reg));
}
}
@@ -23884,7 +23897,7 @@ arm_set_return_address (rtx source, rtx scratch)
else
{
if (frame_pointer_needed)
- addr = plus_constant(hard_frame_pointer_rtx, -4);
+ addr = plus_constant (Pmode, hard_frame_pointer_rtx, -4);
else
{
/* LR will be the first saved register. */
@@ -23901,7 +23914,7 @@ arm_set_return_address (rtx source, rtx scratch)
else
addr = stack_pointer_rtx;
- addr = plus_constant (addr, delta);
+ addr = plus_constant (Pmode, addr, delta);
}
emit_move_insn (gen_frame_mem (Pmode, addr), source);
}
@@ -23953,7 +23966,7 @@ thumb_set_return_address (rtx source, rtx scratch)
addr = scratch;
}
else
- addr = plus_constant (addr, delta);
+ addr = plus_constant (Pmode, addr, delta);
emit_move_insn (gen_frame_mem (Pmode, addr), source);
}
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 0103c2bae5e..b1ad3bf34eb 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4929,7 +4929,8 @@
rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
mem1 = change_address (operands[1], QImode, addr);
- mem2 = change_address (operands[1], QImode, plus_constant (addr, 1));
+ mem2 = change_address (operands[1], QImode,
+ plus_constant (Pmode, addr, 1));
operands[0] = gen_lowpart (SImode, operands[0]);
operands[1] = mem1;
operands[2] = gen_reg_rtx (SImode);
@@ -5445,7 +5446,7 @@
return thumb_load_double_from_address (operands);
case 6:
operands[2] = gen_rtx_MEM (SImode,
- plus_constant (XEXP (operands[0], 0), 4));
+ plus_constant (Pmode, XEXP (operands[0], 0), 4));
output_asm_insn (\"str\\t%1, %0\;str\\t%H1, %2\", operands);
return \"\";
case 7:
@@ -6223,7 +6224,8 @@
rtx addr = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
mem1 = change_address (operands[1], QImode, addr);
- mem2 = change_address (operands[1], QImode, plus_constant (addr, 1));
+ mem2 = change_address (operands[1], QImode,
+ plus_constant (Pmode, addr, 1));
operands[0] = gen_lowpart (SImode, operands[0]);
operands[1] = mem1;
operands[2] = gen_reg_rtx (SImode);
@@ -6746,7 +6748,8 @@
return thumb_load_double_from_address (operands);
case 4:
operands[2] = gen_rtx_MEM (SImode,
- plus_constant (XEXP (operands[0], 0), 4));
+ plus_constant (Pmode,
+ XEXP (operands[0], 0), 4));
output_asm_insn (\"str\\t%1, %0\;str\\t%H1, %2\", operands);
return \"\";
case 5:
@@ -8756,7 +8759,7 @@
rtx reg = XEXP (XVECEXP (par, 0, i), 0);
if (size != 0)
- emit_move_insn (addr, plus_constant (addr, size));
+ emit_move_insn (addr, plus_constant (Pmode, addr, size));
mem = change_address (mem, GET_MODE (reg), NULL);
if (REGNO (reg) == R0_REGNUM)
@@ -8803,7 +8806,7 @@
rtx reg = SET_DEST (XVECEXP (operands[1], 0, i));
if (size != 0)
- emit_move_insn (addr, plus_constant (addr, size));
+ emit_move_insn (addr, plus_constant (Pmode, addr, size));
mem = change_address (mem, GET_MODE (reg), NULL);
if (REGNO (reg) == R0_REGNUM)
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index af00aeea07a..d52ab156c18 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -770,7 +770,7 @@ avr_incoming_return_addr_rtx (void)
{
/* The return address is at the top of the stack. Note that the push
was via post-decrement, which means the actual address is off by one. */
- return gen_frame_mem (HImode, plus_constant (stack_pointer_rtx, 1));
+ return gen_frame_mem (HImode, plus_constant (Pmode, stack_pointer_rtx, 1));
}
/* Helper for expand_prologue. Emit a push of a byte register. */
@@ -866,8 +866,8 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
gen_rtx_SET (VOIDmode, (frame_pointer_needed
? frame_pointer_rtx
: stack_pointer_rtx),
- plus_constant (stack_pointer_rtx,
- -(size + live_seq))));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -(size + live_seq))));
/* Note that live_seq always contains r28+r29, but the other
registers to be saved are all below 18. */
@@ -880,7 +880,8 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
{
rtx m, r;
- m = gen_rtx_MEM (QImode, plus_constant (stack_pointer_rtx, offset));
+ m = gen_rtx_MEM (QImode, plus_constant (Pmode, stack_pointer_rtx,
+ offset));
r = gen_rtx_REG (QImode, reg);
add_reg_note (insn, REG_CFA_OFFSET, gen_rtx_SET (VOIDmode, m, r));
}
@@ -995,13 +996,14 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
gen_rtx_SET (VOIDmode, fp, stack_pointer_rtx));
}
- insn = emit_move_insn (my_fp, plus_constant (my_fp, -size));
+ insn = emit_move_insn (my_fp, plus_constant (Pmode, my_fp, -size));
if (frame_pointer_needed)
{
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, fp,
- plus_constant (fp, -size_cfa)));
+ plus_constant (Pmode, fp,
+ -size_cfa)));
}
/* Copy to stack pointer. Note that since we've already
@@ -1028,8 +1030,9 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -size_cfa)));
+ plus_constant (Pmode,
+ stack_pointer_rtx,
+ -size_cfa)));
}
fp_plus_insns = get_insns ();
@@ -1047,12 +1050,14 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set)
start_sequence ();
insn = emit_move_insn (stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -size));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -size));
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -size_cfa)));
+ plus_constant (Pmode,
+ stack_pointer_rtx,
+ -size_cfa)));
if (frame_pointer_needed)
{
insn = emit_move_insn (fp, stack_pointer_rtx);
@@ -1273,7 +1278,7 @@ expand_epilogue (bool sibcall_p)
if (size)
{
emit_move_insn (frame_pointer_rtx,
- plus_constant (frame_pointer_rtx, size));
+ plus_constant (Pmode, frame_pointer_rtx, size));
}
emit_insn (gen_epilogue_restores (gen_int_mode (live_seq, HImode)));
@@ -1319,7 +1324,7 @@ expand_epilogue (bool sibcall_p)
if (!frame_pointer_needed)
emit_move_insn (fp, stack_pointer_rtx);
- emit_move_insn (my_fp, plus_constant (my_fp, size));
+ emit_move_insn (my_fp, plus_constant (Pmode, my_fp, size));
/* Copy to stack pointer. */
@@ -1344,7 +1349,7 @@ expand_epilogue (bool sibcall_p)
start_sequence ();
emit_move_insn (stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, size));
+ plus_constant (Pmode, stack_pointer_rtx, size));
sp_plus_insns = get_insns ();
end_sequence ();
@@ -6594,7 +6599,7 @@ avr_const_address_lo16 (rtx x)
const char *name = XSTR (XEXP (XEXP (x, 0), 0), 0);
lo16 = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
- lo16 = gen_rtx_CONST (Pmode, plus_constant (lo16, offset));
+ lo16 = gen_rtx_CONST (Pmode, plus_constant (Pmode, lo16, offset));
return lo16;
}
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 577f091a473..1342c568fd0 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -580,7 +580,8 @@ setup_incoming_varargs (cumulative_args_t cum,
for (i = get_cumulative_args (cum)->words + 1; i < max_arg_registers; i++)
{
mem = gen_rtx_MEM (Pmode,
- plus_constant (arg_pointer_rtx, (i * UNITS_PER_WORD)));
+ plus_constant (Pmode, arg_pointer_rtx,
+ (i * UNITS_PER_WORD)));
emit_move_insn (mem, gen_rtx_REG (Pmode, i));
}
@@ -1050,7 +1051,8 @@ bfin_load_pic_reg (rtx dest)
return pic_offset_table_rtx;
if (global_options_set.x_bfin_library_id)
- addr = plus_constant (pic_offset_table_rtx, -4 - bfin_library_id * 4);
+ addr = plus_constant (Pmode, pic_offset_table_rtx,
+ -4 - bfin_library_id * 4);
else
addr = gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
@@ -1111,7 +1113,7 @@ bfin_expand_prologue (void)
}
else
{
- rtx limit = plus_constant (lim, offset);
+ rtx limit = plus_constant (Pmode, lim, offset);
emit_move_insn (p2reg, limit);
lim = p2reg;
}
@@ -1883,7 +1885,7 @@ bfin_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
if (TARGET_FDPIC)
{
- rtx a = force_reg (Pmode, plus_constant (XEXP (m_tramp, 0), 8));
+ rtx a = force_reg (Pmode, plus_constant (Pmode, XEXP (m_tramp, 0), 8));
mem = adjust_address (m_tramp, Pmode, 0);
emit_move_insn (mem, a);
i = 8;
@@ -2077,7 +2079,7 @@ bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx cookie, int sibcall)
picreg = gen_reg_rtx (SImode);
emit_insn (gen_load_funcdescsi (picreg,
- plus_constant (addr, 4)));
+ plus_constant (Pmode, addr, 4)));
}
nelts++;
@@ -4942,7 +4944,8 @@ bfin_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
output_asm_insn ("%2 = r0; %2 = [%2];", xops);
/* Adjust the this parameter. */
- xops[0] = gen_rtx_MEM (Pmode, plus_constant (p2tmp, vcall_offset));
+ xops[0] = gen_rtx_MEM (Pmode, plus_constant (Pmode, p2tmp,
+ vcall_offset));
if (!memory_operand (xops[0], Pmode))
{
rtx tmp2 = gen_rtx_REG (Pmode, REG_P1);
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index cc3b14f504b..03759bffdea 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -784,7 +784,8 @@ typedef struct {
#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM)
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, REG_P2)
#define EH_RETURN_HANDLER_RTX \
- gen_frame_mem (Pmode, plus_constant (frame_pointer_rtx, UNITS_PER_WORD))
+ gen_frame_mem (Pmode, plus_constant (Pmode, frame_pointer_rtx, \
+ UNITS_PER_WORD))
/* Addressing Modes */
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 4cb4ffb4c4c..8a368892bb2 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -735,7 +735,8 @@ c6x_initialize_trampoline (rtx tramp, tree fndecl, rtx cxt)
tramp = XEXP (tramp, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gnu_clear_cache"),
LCT_NORMAL, VOIDmode, 2, tramp, Pmode,
- plus_constant (tramp, TRAMPOLINE_SIZE), Pmode);
+ plus_constant (Pmode, tramp, TRAMPOLINE_SIZE),
+ Pmode);
#endif
}
@@ -822,7 +823,8 @@ c6x_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
output_asm_insn ("ldw .d1t1 %3, %2", xops);
/* Adjust the this parameter. */
- xops[0] = gen_rtx_MEM (Pmode, plus_constant (a0tmp, vcall_offset));
+ xops[0] = gen_rtx_MEM (Pmode, plus_constant (Pmode, a0tmp,
+ vcall_offset));
if (!memory_operand (xops[0], Pmode))
{
rtx tmp2 = gen_rtx_REG (Pmode, REG_A1);
diff --git a/gcc/config/cr16/cr16.c b/gcc/config/cr16/cr16.c
index 65968f8cda7..852c808f571 100644
--- a/gcc/config/cr16/cr16.c
+++ b/gcc/config/cr16/cr16.c
@@ -1851,7 +1851,7 @@ cr16_create_dwarf_for_multi_push (rtx insn)
tmp = gen_rtx_SET (VOIDmode,
gen_frame_mem (mode,
plus_constant
- (stack_pointer_rtx,
+ (Pmode, stack_pointer_rtx,
total_push_bytes - offset)),
reg);
RTX_FRAME_RELATED_P (tmp) = 1;
diff --git a/gcc/config/cr16/cr16.h b/gcc/config/cr16/cr16.h
index 01577ca5448..54794e1fd27 100644
--- a/gcc/config/cr16/cr16.h
+++ b/gcc/config/cr16/cr16.h
@@ -238,7 +238,7 @@ while (0)
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 4)
#define EH_RETURN_HANDLER_RTX \
- gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -4))
+ gen_rtx_MEM (Pmode, plus_constant (Pmode, arg_pointer_rtx, -4))
#define INCOMING_RETURN_ADDR_RTX gen_rtx_RA
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index de9e26984ea..40efd233ebf 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1181,7 +1181,7 @@ cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED)
present). Apparently we can't eliminate from the frame-pointer in
that direction, so use the incoming args (maybe pretended) pointer. */
return count == 0
- ? gen_rtx_MEM (Pmode, plus_constant (virtual_incoming_args_rtx, -4))
+ ? gen_rtx_MEM (Pmode, plus_constant (Pmode, virtual_incoming_args_rtx, -4))
: NULL_RTX;
}
@@ -2815,14 +2815,14 @@ cris_split_movdx (rtx *operands)
operand_subword (dest, reverse, TRUE, mode),
change_address
(src, SImode,
- plus_constant (addr,
+ plus_constant (Pmode, addr,
reverse * UNITS_PER_WORD))));
emit_insn (gen_rtx_SET
(VOIDmode,
operand_subword (dest, ! reverse, TRUE, mode),
change_address
(src, SImode,
- plus_constant (addr,
+ plus_constant (Pmode, addr,
(! reverse) *
UNITS_PER_WORD))));
}
@@ -2882,7 +2882,7 @@ cris_split_movdx (rtx *operands)
emit_insn (gen_rtx_SET
(VOIDmode,
change_address (dest, SImode,
- plus_constant (addr,
+ plus_constant (Pmode, addr,
UNITS_PER_WORD)),
operand_subword (src, 1, TRUE, mode)));
}
@@ -2954,7 +2954,8 @@ cris_expand_prologue (void)
{
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
-4)));
/* FIXME: When dwarf2 frame output and unless asynchronous
exceptions, make dwarf2 bundle together all stack
@@ -2982,7 +2983,7 @@ cris_expand_prologue (void)
{
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-4 - pretend)));
pretend = 0;
RTX_FRAME_RELATED_P (insn) = 1;
@@ -2999,7 +3000,7 @@ cris_expand_prologue (void)
{
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-4 - pretend)));
pretend = 0;
RTX_FRAME_RELATED_P (insn) = 1;
@@ -3052,7 +3053,7 @@ cris_expand_prologue (void)
{
mem
= gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-(n_saved * 4 + size)));
set_mem_alias_set (mem, get_frame_alias_set ());
insn
@@ -3065,7 +3066,7 @@ cris_expand_prologue (void)
insn
= gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-(n_saved * 4 + size)));
insn = emit_insn (insn);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -3083,7 +3084,8 @@ cris_expand_prologue (void)
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
-4 - size)));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -3113,7 +3115,7 @@ cris_expand_prologue (void)
{
mem
= gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-(n_saved * 4 + size)));
set_mem_alias_set (mem, get_frame_alias_set ());
insn = cris_emit_movem_store (mem, GEN_INT (n_saved),
@@ -3124,7 +3126,7 @@ cris_expand_prologue (void)
insn
= gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-(n_saved * 4 + size)));
insn = emit_insn (insn);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -3140,7 +3142,8 @@ cris_expand_prologue (void)
{
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
-cfoa_size)));
RTX_FRAME_RELATED_P (insn) = 1;
framesize += cfoa_size;
@@ -3150,7 +3153,8 @@ cris_expand_prologue (void)
{
insn = emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
-(cfoa_size + size))));
RTX_FRAME_RELATED_P (insn) = 1;
framesize += size + cfoa_size;
@@ -3248,7 +3252,7 @@ cris_expand_epilogue (void)
the saved registers. We have to adjust for that. */
emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
argspace_offset)));
/* Make sure we only do this once. */
argspace_offset = 0;
@@ -3274,7 +3278,7 @@ cris_expand_epilogue (void)
{
emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
argspace_offset)));
argspace_offset = 0;
}
@@ -3333,7 +3337,7 @@ cris_expand_epilogue (void)
emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, size)));
+ plus_constant (Pmode, stack_pointer_rtx, size)));
}
/* If this function has no pushed register parameters
@@ -3395,7 +3399,8 @@ cris_expand_epilogue (void)
emit_insn (gen_rtx_SET (VOIDmode,
stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, pretend)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ pretend)));
}
/* Perform the "physical" unwinding that the EH machinery calculated. */
@@ -3443,7 +3448,8 @@ cris_gen_movem_load (rtx src, rtx nregs_rtx, int nprefix)
if (GET_CODE (XEXP (src, 0)) == POST_INC)
{
RTVEC_ELT (vec, nprefix + 1)
- = gen_rtx_SET (VOIDmode, srcreg, plus_constant (srcreg, nregs * 4));
+ = gen_rtx_SET (VOIDmode, srcreg,
+ plus_constant (Pmode, srcreg, nregs * 4));
eltno++;
}
@@ -3514,7 +3520,8 @@ cris_emit_movem_store (rtx dest, rtx nregs_rtx, int increment,
RTVEC_ELT (vec, 0) = mov;
RTVEC_ELT (vec, 1) = gen_rtx_SET (VOIDmode, destreg,
- plus_constant (destreg, increment));
+ plus_constant (Pmode, destreg,
+ increment));
if (frame_related)
{
RTX_FRAME_RELATED_P (mov) = 1;
@@ -3527,7 +3534,7 @@ cris_emit_movem_store (rtx dest, rtx nregs_rtx, int increment,
RTVEC_ELT (vec, 0)
= gen_rtx_SET (VOIDmode,
replace_equiv_address (dest,
- plus_constant (destreg,
+ plus_constant (Pmode, destreg,
increment)),
gen_rtx_REG (SImode, regno));
regno += regno_inc;
@@ -3542,7 +3549,7 @@ cris_emit_movem_store (rtx dest, rtx nregs_rtx, int increment,
{
RTVEC_ELT (vec, 1)
= gen_rtx_SET (VOIDmode, destreg,
- plus_constant (destreg,
+ plus_constant (Pmode, destreg,
increment != 0
? increment : nregs * 4));
eltno++;
@@ -4143,7 +4150,7 @@ cris_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
if (TARGET_V32)
{
mem = adjust_address (m_tramp, SImode, 6);
- emit_move_insn (mem, plus_constant (tramp, 38));
+ emit_move_insn (mem, plus_constant (Pmode, tramp, 38));
mem = adjust_address (m_tramp, SImode, 22);
emit_move_insn (mem, chain_value);
mem = adjust_address (m_tramp, SImode, 28);
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 92657d12750..b4ead76f38b 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -976,7 +976,7 @@
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym),
CRIS_UNSPEC_PCREL);
if (offs != 0)
- tem = plus_constant (tem, offs);
+ tem = plus_constant (Pmode, tem, offs);
rm = rn;
emit_move_insn (rm, gen_rtx_CONST (Pmode, tem));
}
@@ -988,7 +988,7 @@
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym),
CRIS_UNSPEC_GOTREL);
if (offs != 0)
- tem = plus_constant (tem, offs);
+ tem = plus_constant (Pmode, tem, offs);
rm = gen_reg_rtx (Pmode);
emit_move_insn (rm, gen_rtx_CONST (Pmode, tem));
if (expand_binop (Pmode, add_optab, rm, pic_offset_table_rtx,
@@ -3868,7 +3868,7 @@
(use (label_ref (match_operand 3 "" "")))])]
""
{
- operands[2] = plus_constant (operands[2], 1);
+ operands[2] = plus_constant (SImode, operands[2], 1);
operands[5] = gen_reg_rtx (SImode);
operands[6] = gen_reg_rtx (SImode);
operands[7] = gen_reg_rtx (SImode);
@@ -3903,7 +3903,7 @@
rtx xlabel = gen_rtx_LABEL_REF (VOIDmode, operands[3]);
for (i = 5; i <= 10; i++)
operands[i] = gen_reg_rtx (SImode);
- operands[2] = plus_constant (operands[2], 1);
+ operands[2] = plus_constant (SImode, operands[2], 1);
/* Don't forget to decorate labels too, for PIC. */
operands[11] = flag_pic
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 15efaa3d8a7..10cbdc39a3f 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -687,7 +687,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
orig = machopic_indirect_data_reference (XEXP (orig, 1),
(base == reg ? 0 : reg));
if (MACHOPIC_INDIRECT && (GET_CODE (orig) == CONST_INT))
- result = plus_constant (base, INTVAL (orig));
+ result = plus_constant (Pmode, base, INTVAL (orig));
else
result = gen_rtx_PLUS (Pmode, base, orig);
@@ -972,7 +972,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
Pmode, (base == reg ? 0 : reg));
if (GET_CODE (orig) == CONST_INT)
{
- pic_ref = plus_constant (base, INTVAL (orig));
+ pic_ref = plus_constant (Pmode, base, INTVAL (orig));
is_complex = 1;
}
else
diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index 422fe2fe795..f1a8db76353 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -1555,7 +1555,8 @@ epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
if (current_frame_info.first_slot_size > UNITS_PER_WORD)
{
mode = DImode;
- addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ addr = plus_constant (Pmode, addr,
+ - (HOST_WIDE_INT) UNITS_PER_WORD);
}
if (i-- < min || !epilogue_p)
goto next_slot;
@@ -1588,7 +1589,8 @@ epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
{
mode = DImode;
i++;
- addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ addr = plus_constant (Pmode, addr,
+ - (HOST_WIDE_INT) UNITS_PER_WORD);
}
/* If it fits in the following stack slot pair, that's fine, too. */
else if (GET_CODE (addr) == PLUS && (stack_offset & 7) == 4
@@ -1603,7 +1605,8 @@ epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
skipped_mem = gen_mem (mode, addr);
mode = DImode;
i++;
- addr = plus_constant (addr, - (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
+ addr = plus_constant (Pmode, addr,
+ - (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
}
}
reg = gen_rtx_REG (mode, n);
@@ -1621,7 +1624,7 @@ epiphany_emit_save_restore (int min, int limit, rtx addr, int epilogue_p)
continue;
}
next_slot:
- addr = plus_constant (addr, - (HOST_WIDE_INT) UNITS_PER_WORD);
+ addr = plus_constant (Pmode, addr, -(HOST_WIDE_INT) UNITS_PER_WORD);
stack_offset -= GET_MODE_SIZE (mode);
}
}
@@ -1646,7 +1649,7 @@ epiphany_expand_prologue (void)
if (interrupt_p)
{
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
- (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
if (!lookup_attribute ("forwarder_section",
DECL_ATTRIBUTES (current_function_decl))
@@ -1663,13 +1666,13 @@ epiphany_expand_prologue (void)
frame_insn (gen_stack_adjust_add (off, mem));
if (!epiphany_uninterruptible_p (current_function_decl))
emit_insn (gen_gie ());
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
current_frame_info.first_slot_offset
- (HOST_WIDE_INT) 3 * UNITS_PER_WORD);
}
else
{
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
epiphany_stack_offset
- (HOST_WIDE_INT) UNITS_PER_WORD);
epiphany_emit_save_restore (0, current_frame_info.small_threshold,
@@ -1689,7 +1692,8 @@ epiphany_expand_prologue (void)
(gen_frame_mem (mode, stack_pointer_rtx),
gen_rtx_REG (mode, current_frame_info.first_slot),
off, mem));
- addr = plus_constant (addr, current_frame_info.first_slot_offset);
+ addr = plus_constant (Pmode, addr,
+ current_frame_info.first_slot_offset);
}
}
epiphany_emit_save_restore (current_frame_info.small_threshold,
@@ -1718,7 +1722,7 @@ epiphany_expand_prologue (void)
else if (current_frame_info.last_slot_offset)
{
mem = gen_frame_mem (BLKmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
current_frame_info.last_slot_offset));
off = GEN_INT (-current_frame_info.last_slot_offset);
if (!SIMM11 (INTVAL (off)))
@@ -1797,7 +1801,7 @@ epiphany_expand_epilogue (int sibcall_p)
restore_offset = (interrupt_p
? - 3 * UNITS_PER_WORD
: epiphany_stack_offset - (HOST_WIDE_INT) UNITS_PER_WORD);
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
(current_frame_info.first_slot_offset
+ restore_offset));
epiphany_emit_save_restore (current_frame_info.small_threshold,
@@ -1832,12 +1836,12 @@ epiphany_expand_epilogue (int sibcall_p)
gen_rtx_REG (SImode, GPR_0));
emit_move_insn (gen_rtx_REG (word_mode, IRET_REGNUM),
gen_rtx_REG (SImode, GPR_0+1));
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
- (HOST_WIDE_INT) 2 * UNITS_PER_WORD);
emit_move_insn (gen_rtx_REG (DImode, GPR_0),
gen_frame_mem (DImode, addr));
}
- addr = plus_constant (stack_pointer_rtx,
+ addr = plus_constant (Pmode, stack_pointer_rtx,
epiphany_stack_offset - (HOST_WIDE_INT) UNITS_PER_WORD);
epiphany_emit_save_restore (0, current_frame_info.small_threshold, addr, 1);
if (!sibcall_p)
@@ -2181,19 +2185,19 @@ epiphany_trampoline_init (rtx tramp_mem, tree fndecl, rtx cxt)
rtx fnaddr = XEXP (DECL_RTL (fndecl), 0);
rtx tramp = force_reg (Pmode, XEXP (tramp_mem, 0));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 0)),
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (Pmode, tramp, 0)),
gen_rtx_IOR (SImode, GEN_INT (0x4002000b),
EPIPHANY_LOW_RTX (fnaddr)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 4)),
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (Pmode, tramp, 4)),
gen_rtx_IOR (SImode, GEN_INT (0x5002000b),
EPIPHANY_HIGH_RTX (fnaddr)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 8)),
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (Pmode, tramp, 8)),
gen_rtx_IOR (SImode, GEN_INT (0x2002800b),
EPIPHANY_LOW_RTX (cxt)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 12)),
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (Pmode, tramp, 12)),
gen_rtx_IOR (SImode, GEN_INT (0x3002800b),
EPIPHANY_HIGH_RTX (cxt)));
- emit_move_insn (gen_rtx_MEM (SImode, plus_constant (tramp, 16)),
+ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (Pmode, tramp, 16)),
GEN_INT (0x0802014f));
}
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index b192153ccf4..22863e8150e 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -265,7 +265,7 @@
rtx addr
= (frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx);
- addr = plus_constant (addr, MACHINE_FUNCTION (cfun)->lr_slot_offset);
+ addr = plus_constant (Pmode, addr, MACHINE_FUNCTION (cfun)->lr_slot_offset);
operands[1] = gen_frame_mem (SImode, addr);
})
@@ -373,12 +373,12 @@
if (post_modify_operand (operands[0], <MODE>mode))
operands[2]
= change_address (operands[2], VOIDmode,
- plus_constant (XEXP (XEXP (operands[0], 0), 0),
+ plus_constant (Pmode, XEXP (XEXP (operands[0], 0), 0),
UNITS_PER_WORD));
if (post_modify_operand (operands[1], <MODE>mode))
operands[3]
= change_address (operands[3], VOIDmode,
- plus_constant (XEXP (XEXP (operands[1], 0), 0),
+ plus_constant (Pmode, XEXP (XEXP (operands[1], 0), 0),
UNITS_PER_WORD));
}
[(set_attr "type" "move,move,load,store")
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index e6a3712a3f9..edb8dc4669b 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -936,7 +936,8 @@ fr30_move_double (rtx * operands)
emit_insn (gen_rtx_SET (VOIDmode, dest0,
adjust_address (src, SImode, 0)));
emit_insn (gen_rtx_SET (SImode, dest1,
- plus_constant (dest1, UNITS_PER_WORD)));
+ plus_constant (SImode, dest1,
+ UNITS_PER_WORD)));
new_mem = gen_rtx_MEM (SImode, dest1);
MEM_COPY_ATTRIBUTES (new_mem, src);
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 1354d374396..ace9e437118 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1586,7 +1586,7 @@ frv_dwarf_store (rtx reg, int offset)
{
rtx set = gen_rtx_SET (VOIDmode,
gen_rtx_MEM (GET_MODE (reg),
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
offset)),
reg);
RTX_FRAME_RELATED_P (set) = 1;
@@ -1821,9 +1821,9 @@ frv_expand_prologue (void)
/* ASM_SRC and DWARF_SRC both point to the frame header. ASM_SRC is
based on ACCESSOR.BASE but DWARF_SRC is always based on the stack
pointer. */
- rtx asm_src = plus_constant (accessor.base,
+ rtx asm_src = plus_constant (Pmode, accessor.base,
fp_offset - accessor.base_offset);
- rtx dwarf_src = plus_constant (sp, fp_offset);
+ rtx dwarf_src = plus_constant (Pmode, sp, fp_offset);
/* Store the old frame pointer at (sp + FP_OFFSET). */
frv_frame_access (&accessor, fp, fp_offset);
@@ -2272,8 +2272,8 @@ frv_expand_block_move (rtx operands[])
}
else
{
- src_addr = plus_constant (src_reg, offset);
- dest_addr = plus_constant (dest_reg, offset);
+ src_addr = plus_constant (Pmode, src_reg, offset);
+ dest_addr = plus_constant (Pmode, dest_reg, offset);
}
/* Generate the appropriate load and store, saving the stores
@@ -2357,7 +2357,7 @@ frv_expand_block_clear (rtx operands[])
/* Calculate the correct offset for src/dest. */
dest_addr = ((offset == 0)
? dest_reg
- : plus_constant (dest_reg, offset));
+ : plus_constant (Pmode, dest_reg, offset));
/* Generate the appropriate store of gr0. */
if (bytes >= 4 && align >= 4)
@@ -2471,7 +2471,7 @@ frv_return_addr_rtx (int count, rtx frame)
if (count != 0)
return const0_rtx;
cfun->machine->frame_needed = 1;
- return gen_rtx_MEM (Pmode, plus_constant (frame, 8));
+ return gen_rtx_MEM (Pmode, plus_constant (Pmode, frame, 8));
}
/* Given a memory reference MEMREF, interpret the referenced memory as
@@ -2489,7 +2489,8 @@ frv_index_memory (rtx memref, enum machine_mode mode, int index)
if (GET_CODE (base) == PRE_MODIFY)
base = XEXP (base, 0);
return change_address (memref, mode,
- plus_constant (base, index * GET_MODE_SIZE (mode)));
+ plus_constant (Pmode, base,
+ index * GET_MODE_SIZE (mode)));
}
@@ -3741,7 +3742,8 @@ static void
frv_output_const_unspec (FILE *stream, const struct frv_unspec *unspec)
{
fprintf (stream, "#%s(", unspec_got_name (unspec->reloc));
- output_addr_const (stream, plus_constant (unspec->symbol, unspec->offset));
+ output_addr_const (stream, plus_constant (Pmode, unspec->symbol,
+ unspec->offset));
fputs (")", stream);
}
@@ -3756,7 +3758,7 @@ frv_find_base_term (rtx x)
if (frv_const_unspec_p (x, &unspec)
&& frv_small_data_reloc_p (unspec.symbol, unspec.reloc))
- return plus_constant (unspec.symbol, unspec.offset);
+ return plus_constant (Pmode, unspec.symbol, unspec.offset);
return x;
}
@@ -9647,7 +9649,7 @@ frv_output_dwarf_dtprel (FILE *file, int size, rtx x)
fputs ("\t.picptr\ttlsmoff(", file);
/* We want the unbiased TLS offset, so add the bias to the
expression, such that the implicit biasing cancels out. */
- output_addr_const (file, plus_constant (x, TLS_BIAS));
+ output_addr_const (file, plus_constant (Pmode, x, TLS_BIAS));
fputs (")", file);
}
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 7eaaf202f00..f165fdf66f6 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -678,12 +678,13 @@ h8300_push_pop (int regno, int nregs, bool pop_p, bool return_p)
/* Register REGNO + NREGS - 1 is popped first. Before the
stack adjustment, its slot is at address @sp. */
lhs = gen_rtx_REG (SImode, regno + j);
- rhs = gen_rtx_MEM (SImode, plus_constant (sp, (nregs - j - 1) * 4));
+ rhs = gen_rtx_MEM (SImode, plus_constant (Pmode, sp,
+ (nregs - j - 1) * 4));
}
else
{
/* Register REGNO is pushed first and will be stored at @(-4,sp). */
- lhs = gen_rtx_MEM (SImode, plus_constant (sp, (j + 1) * -4));
+ lhs = gen_rtx_MEM (SImode, plus_constant (Pmode, sp, (j + 1) * -4));
rhs = gen_rtx_REG (SImode, regno + j);
}
RTVEC_ELT (vec, i + j) = gen_rtx_SET (VOIDmode, lhs, rhs);
@@ -2002,7 +2003,8 @@ h8300_return_addr_rtx (int count, rtx frame)
else
ret = gen_rtx_MEM (Pmode,
memory_address (Pmode,
- plus_constant (frame, UNITS_PER_WORD)));
+ plus_constant (Pmode, frame,
+ UNITS_PER_WORD)));
set_mem_alias_set (ret, get_frame_alias_set ());
return ret;
}
@@ -2719,17 +2721,17 @@ h8300_swap_into_er6 (rtx addr)
rtx insn = push (HARD_FRAME_POINTER_REGNUM);
if (frame_pointer_needed)
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (gen_rtx_MEM (Pmode, stack_pointer_rtx),
+ plus_constant (Pmode, gen_rtx_MEM (Pmode, stack_pointer_rtx),
2 * UNITS_PER_WORD));
else
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, 4)));
+ plus_constant (Pmode, stack_pointer_rtx, 4)));
emit_move_insn (hard_frame_pointer_rtx, addr);
if (REGNO (addr) == SP_REG)
emit_move_insn (hard_frame_pointer_rtx,
- plus_constant (hard_frame_pointer_rtx,
+ plus_constant (Pmode, hard_frame_pointer_rtx,
GET_MODE_SIZE (word_mode)));
}
@@ -2748,11 +2750,12 @@ h8300_swap_out_of_er6 (rtx addr)
RTX_FRAME_RELATED_P (insn) = 1;
if (frame_pointer_needed)
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (hard_frame_pointer_rtx, 2 * UNITS_PER_WORD));
+ plus_constant (Pmode, hard_frame_pointer_rtx,
+ 2 * UNITS_PER_WORD));
else
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -4)));
+ plus_constant (Pmode, stack_pointer_rtx, -4)));
}
/* Return the length of mov instruction. */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1b8d07486d9..953b6689443 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -7699,7 +7699,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
for (i = cum->regno; i < max; i++)
{
mem = gen_rtx_MEM (word_mode,
- plus_constant (save_area, i * UNITS_PER_WORD));
+ plus_constant (Pmode, save_area, i * UNITS_PER_WORD));
MEM_NOTRAP_P (mem) = 1;
set_mem_alias_set (mem, set);
emit_move_insn (mem,
@@ -7735,7 +7735,8 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
for (i = cum->sse_regno; i < max; ++i)
{
- mem = plus_constant (save_area, i * 16 + ix86_varargs_gpr_size);
+ mem = plus_constant (Pmode, save_area,
+ i * 16 + ix86_varargs_gpr_size);
mem = gen_rtx_MEM (smode, mem);
MEM_NOTRAP_P (mem) = 1;
set_mem_alias_set (mem, set);
@@ -7764,7 +7765,7 @@ setup_incoming_varargs_ms_64 (CUMULATIVE_ARGS *cum)
rtx reg, mem;
mem = gen_rtx_MEM (Pmode,
- plus_constant (virtual_incoming_args_rtx,
+ plus_constant (Pmode, virtual_incoming_args_rtx,
i * UNITS_PER_WORD));
MEM_NOTRAP_P (mem) = 1;
set_mem_alias_set (mem, set);
@@ -9233,7 +9234,7 @@ choose_baseaddr (HOST_WIDE_INT cfa_offset)
}
gcc_assert (base_reg != NULL);
- return plus_constant (base_reg, base_offset);
+ return plus_constant (Pmode, base_reg, base_offset);
}
/* Emit code to save registers in the prologue. */
@@ -9288,7 +9289,7 @@ ix86_emit_save_reg_using_mov (enum machine_mode mode, unsigned int regno,
the re-aligned stack frame, which provides us with a copy
of the CFA that will last past the prologue. Install it. */
gcc_checking_assert (cfun->machine->fs.fp_valid);
- addr = plus_constant (hard_frame_pointer_rtx,
+ addr = plus_constant (Pmode, hard_frame_pointer_rtx,
cfun->machine->fs.fp_offset - cfa_offset);
mem = gen_rtx_MEM (mode, addr);
add_reg_note (insn, REG_CFA_DEF_CFA, mem);
@@ -9298,7 +9299,7 @@ ix86_emit_save_reg_using_mov (enum machine_mode mode, unsigned int regno,
/* The frame pointer is a stable reference within the
aligned frame. Use it. */
gcc_checking_assert (cfun->machine->fs.fp_valid);
- addr = plus_constant (hard_frame_pointer_rtx,
+ addr = plus_constant (Pmode, hard_frame_pointer_rtx,
cfun->machine->fs.fp_offset - cfa_offset);
mem = gen_rtx_MEM (mode, addr);
add_reg_note (insn, REG_CFA_EXPRESSION,
@@ -9311,7 +9312,8 @@ ix86_emit_save_reg_using_mov (enum machine_mode mode, unsigned int regno,
use by the unwind info. */
else if (base != m->fs.cfa_reg)
{
- addr = plus_constant (m->fs.cfa_reg, m->fs.cfa_offset - cfa_offset);
+ addr = plus_constant (Pmode, m->fs.cfa_reg,
+ m->fs.cfa_offset - cfa_offset);
mem = gen_rtx_MEM (mode, addr);
add_reg_note (insn, REG_CFA_OFFSET, gen_rtx_SET (VOIDmode, mem, reg));
}
@@ -9757,7 +9759,8 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
adjust = PROBE_INTERVAL;
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -adjust)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -adjust)));
emit_stack_probe (stack_pointer_rtx);
}
@@ -9767,12 +9770,13 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
adjust = size + PROBE_INTERVAL - i;
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -adjust)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -adjust)));
emit_stack_probe (stack_pointer_rtx);
/* Adjust back to account for the additional first interval. */
last = emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
PROBE_INTERVAL + dope)));
}
@@ -9798,7 +9802,7 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
/* SP = SP_0 + PROBE_INTERVAL. */
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
- (PROBE_INTERVAL + dope))));
/* LAST_ADDR = SP_0 + PROBE_INTERVAL + ROUNDED_SIZE. */
@@ -9828,14 +9832,14 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
if (size != rounded_size)
{
emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
rounded_size - size)));
emit_stack_probe (stack_pointer_rtx);
}
/* Adjust back to account for the additional first interval. */
last = emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
PROBE_INTERVAL + dope)));
release_scratch_register_on_entry (&sr);
@@ -9851,10 +9855,10 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
rtx expr = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (2));
XVECEXP (expr, 0, 0)
= gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -size));
+ plus_constant (Pmode, stack_pointer_rtx, -size));
XVECEXP (expr, 0, 1)
= gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
PROBE_INTERVAL + dope + size));
add_reg_note (last, REG_FRAME_RELATED_EXPR, expr);
RTX_FRAME_RELATED_P (last) = 1;
@@ -9923,9 +9927,11 @@ ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
it exceeds SIZE. If only one probe is needed, this will not
generate any code. Then probe at FIRST + SIZE. */
for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
- emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + i)));
+ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
+ -(first + i)));
- emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + size)));
+ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
+ -(first + size)));
}
/* Otherwise, do the same as above, but in a loop. Note that we must be
@@ -9973,7 +9979,8 @@ ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
that SIZE is equal to ROUNDED_SIZE. */
if (size != rounded_size)
- emit_stack_probe (plus_constant (gen_rtx_PLUS (Pmode,
+ emit_stack_probe (plus_constant (Pmode,
+ gen_rtx_PLUS (Pmode,
stack_pointer_rtx,
sr.reg),
rounded_size - size));
@@ -10226,7 +10233,7 @@ ix86_expand_prologue (void)
/* We don't want to interpret this push insn as a register save,
only as a stack adjustment. The real copy of the register as
a save will be done later, if needed. */
- t = plus_constant (stack_pointer_rtx, -UNITS_PER_WORD);
+ t = plus_constant (Pmode, stack_pointer_rtx, -UNITS_PER_WORD);
t = gen_rtx_SET (VOIDmode, stack_pointer_rtx, t);
add_reg_note (insn, REG_CFA_ADJUST_CFA, t);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -10247,7 +10254,7 @@ ix86_expand_prologue (void)
}
/* Grab the argument pointer. */
- t = plus_constant (stack_pointer_rtx, m->fs.sp_offset);
+ t = plus_constant (Pmode, stack_pointer_rtx, m->fs.sp_offset);
insn = emit_insn (gen_rtx_SET (VOIDmode, crtl->drap_reg, t));
RTX_FRAME_RELATED_P (insn) = 1;
m->fs.cfa_reg = crtl->drap_reg;
@@ -10263,7 +10270,7 @@ ix86_expand_prologue (void)
address can be reached via (argp - 1) slot. This is needed
to implement macro RETURN_ADDR_RTX and intrinsic function
expand_builtin_return_addr etc. */
- t = plus_constant (crtl->drap_reg, -UNITS_PER_WORD);
+ t = plus_constant (Pmode, crtl->drap_reg, -UNITS_PER_WORD);
t = gen_frame_mem (word_mode, t);
insn = emit_insn (gen_push (t));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -10453,7 +10460,7 @@ ix86_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
-allocate)));
}
m->fs.sp_offset += allocate;
@@ -10608,7 +10615,7 @@ ix86_emit_restore_reg_using_pop (rtx reg)
if (m->fs.cfa_reg == stack_pointer_rtx)
{
- rtx x = plus_constant (stack_pointer_rtx, UNITS_PER_WORD);
+ rtx x = plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD);
x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
add_reg_note (insn, REG_CFA_ADJUST_CFA, x);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -10670,7 +10677,8 @@ ix86_emit_leave (void)
m->fs.cfa_offset = m->fs.sp_offset;
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (stack_pointer_rtx, m->fs.sp_offset));
+ plus_constant (Pmode, stack_pointer_rtx,
+ m->fs.sp_offset));
RTX_FRAME_RELATED_P (insn) = 1;
}
ix86_add_cfa_restore_note (insn, hard_frame_pointer_rtx,
@@ -10883,7 +10891,7 @@ ix86_expand_epilogue (int style)
if (frame_pointer_needed)
{
t = gen_rtx_PLUS (Pmode, hard_frame_pointer_rtx, sa);
- t = plus_constant (t, m->fs.fp_offset - UNITS_PER_WORD);
+ t = plus_constant (Pmode, t, m->fs.fp_offset - UNITS_PER_WORD);
emit_insn (gen_rtx_SET (VOIDmode, sa, t));
t = gen_frame_mem (Pmode, hard_frame_pointer_rtx);
@@ -10898,7 +10906,7 @@ ix86_expand_epilogue (int style)
bother resetting the CFA to the SP for the duration of
the return insn. */
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (sa, UNITS_PER_WORD));
+ plus_constant (Pmode, sa, UNITS_PER_WORD));
ix86_add_queued_cfa_restore_notes (insn);
add_reg_note (insn, REG_CFA_RESTORE, hard_frame_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -10913,7 +10921,7 @@ ix86_expand_epilogue (int style)
else
{
t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, sa);
- t = plus_constant (t, m->fs.sp_offset - UNITS_PER_WORD);
+ t = plus_constant (Pmode, t, m->fs.sp_offset - UNITS_PER_WORD);
insn = emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx, t));
ix86_add_queued_cfa_restore_notes (insn);
@@ -10922,7 +10930,7 @@ ix86_expand_epilogue (int style)
{
m->fs.cfa_offset = UNITS_PER_WORD;
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
UNITS_PER_WORD));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -12587,7 +12595,7 @@ legitimize_pic_address (rtx orig, rtx reg)
base == reg ? NULL_RTX : reg);
if (CONST_INT_P (new_rtx))
- new_rtx = plus_constant (base, INTVAL (new_rtx));
+ new_rtx = plus_constant (Pmode, base, INTVAL (new_rtx));
else
{
if (GET_CODE (new_rtx) == PLUS && CONSTANT_P (XEXP (new_rtx, 1)))
@@ -13107,7 +13115,8 @@ ix86_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
x = gen_rtx_PLUS (Pmode,
gen_rtx_PLUS (Pmode, XEXP (XEXP (x, 0), 0),
XEXP (XEXP (XEXP (x, 0), 1), 0)),
- plus_constant (other, INTVAL (constant)));
+ plus_constant (Pmode, other,
+ INTVAL (constant)));
}
}
@@ -20685,7 +20694,7 @@ ix86_split_long_move (rtx operands[])
/* Compensate for the stack decrement by 4. */
if (!TARGET_64BIT && nparts == 3
&& mode == XFmode && TARGET_128BIT_LONG_DOUBLE)
- src_base = plus_constant (src_base, 4);
+ src_base = plus_constant (Pmode, src_base, 4);
/* src_base refers to the stack pointer and is
automatically decreased by emitted push. */
@@ -20749,7 +20758,7 @@ ix86_split_long_move (rtx operands[])
part[1][0] = replace_equiv_address (part[1][0], base);
for (i = 1; i < nparts; i++)
{
- tmp = plus_constant (base, UNITS_PER_WORD * i);
+ tmp = plus_constant (Pmode, base, UNITS_PER_WORD * i);
part[1][i] = replace_equiv_address (part[1][i], tmp);
}
}
@@ -22365,7 +22374,8 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp,
sufficiently aligned, maintain aliasing info accurately. */
dst = expand_constant_movmem_prologue (dst, &src, destreg, srcreg,
desired_align, align_bytes);
- count_exp = plus_constant (count_exp, -align_bytes);
+ count_exp = plus_constant (counter_mode (count_exp),
+ count_exp, -align_bytes);
count -= align_bytes;
}
if (need_zero_guard
@@ -22757,7 +22767,8 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp,
sufficiently aligned, maintain aliasing info accurately. */
dst = expand_constant_setmem_prologue (dst, destreg, promoted_val,
desired_align, align_bytes);
- count_exp = plus_constant (count_exp, -align_bytes);
+ count_exp = plus_constant (counter_mode (count_exp),
+ count_exp, -align_bytes);
count -= align_bytes;
}
if (need_zero_guard
@@ -24464,7 +24475,8 @@ ix86_static_chain (const_tree fndecl, bool incoming_p)
if (fndecl == current_function_decl)
ix86_static_chain_on_stack = true;
return gen_frame_mem (SImode,
- plus_constant (arg_pointer_rtx, -8));
+ plus_constant (Pmode,
+ arg_pointer_rtx, -8));
}
regno = SI_REG;
}
@@ -24586,7 +24598,7 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
(call-saved) register static chain; this push is 1 byte. */
offset += 5;
disp = expand_binop (SImode, sub_optab, fnaddr,
- plus_constant (XEXP (m_tramp, 0),
+ plus_constant (Pmode, XEXP (m_tramp, 0),
offset - (MEM_P (chain) ? 1 : 0)),
NULL_RTX, 1, OPTAB_DIRECT);
emit_move_insn (mem, disp);
@@ -32567,7 +32579,7 @@ x86_this_parameter (tree function)
regno = CX_REG;
if (aggr)
return gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, 4));
+ plus_constant (Pmode, stack_pointer_rtx, 4));
}
else
{
@@ -32577,13 +32589,15 @@ x86_this_parameter (tree function)
regno = DX_REG;
if (nregs == 1)
return gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, 4));
+ plus_constant (Pmode,
+ stack_pointer_rtx, 4));
}
}
return gen_rtx_REG (SImode, regno);
}
- return gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, aggr ? 8 : 4));
+ return gen_rtx_MEM (SImode, plus_constant (Pmode, stack_pointer_rtx,
+ aggr ? 8 : 4));
}
/* Determine whether x86_output_mi_thunk can succeed. */
@@ -32685,7 +32699,7 @@ x86_output_mi_thunk (FILE *file,
emit_move_insn (tmp, this_mem);
/* Adjust the this parameter. */
- vcall_addr = plus_constant (tmp, vcall_offset);
+ vcall_addr = plus_constant (Pmode, tmp, vcall_offset);
if (TARGET_64BIT
&& !ix86_legitimate_address_p (ptr_mode, vcall_addr, true))
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index bd4899b1b64..ddb36459e93 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1912,8 +1912,9 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
- ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, -UNITS_PER_WORD)) \
- : gen_rtx_MEM (Pmode, plus_constant (FRAME, UNITS_PER_WORD)))
+ ? gen_rtx_MEM (Pmode, plus_constant (Pmode, arg_pointer_rtx, \
+ -UNITS_PER_WORD)) \
+ : gen_rtx_MEM (Pmode, plus_constant (Pmode, FRAME, UNITS_PER_WORD)))
/* PC is dbx register 8; let's use that column for RA. */
#define DWARF_FRAME_RETURN_COLUMN (TARGET_64BIT ? 16 : 8)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 9da00cc53d4..f0725c7ed9c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -6349,7 +6349,7 @@
operands[2] = GEN_INT (1 << INTVAL (operands[2]));
- pat = plus_constant (gen_rtx_MULT (mode, operands[1], operands[2]),
+ pat = plus_constant (mode, gen_rtx_MULT (mode, operands[1], operands[2]),
INTVAL (operands[3]));
emit_insn (gen_rtx_SET (VOIDmode, operands[0], pat));
@@ -11964,7 +11964,7 @@
be returning into someone else's stack frame, one word below the
stack address we wish to restore. */
tmp = gen_rtx_PLUS (Pmode, arg_pointer_rtx, sa);
- tmp = plus_constant (tmp, -UNITS_PER_WORD);
+ tmp = plus_constant (Pmode, tmp, -UNITS_PER_WORD);
tmp = gen_rtx_MEM (Pmode, tmp);
emit_move_insn (tmp, ra);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c6595064606..89a65ff82a2 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1104,7 +1104,7 @@ ia64_expand_load_address (rtx dest, rtx src)
if (lo != 0)
{
addend = lo;
- src = plus_constant (XEXP (XEXP (src, 0), 0), hi);
+ src = plus_constant (Pmode, XEXP (XEXP (src, 0), 0), hi);
}
}
@@ -1213,7 +1213,7 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1,
addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000;
addend_hi = addend - addend_lo;
- op1 = plus_constant (op1, addend_hi);
+ op1 = plus_constant (Pmode, op1, addend_hi);
addend = addend_lo;
tmp = gen_reg_rtx (Pmode);
@@ -1290,7 +1290,7 @@ ia64_expand_move (rtx op0, rtx op1)
if (addend_lo != 0)
{
- op1 = plus_constant (sym, addend_hi);
+ op1 = plus_constant (mode, sym, addend_hi);
addend = addend_lo;
}
else
@@ -1441,7 +1441,8 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead)
(in, DImode, gen_rtx_POST_INC (Pmode, base), 0);
out[1] = adjust_automodify_address
(in, DImode,
- gen_rtx_POST_MODIFY (Pmode, base, plus_constant (base, -24)),
+ gen_rtx_POST_MODIFY (Pmode, base,
+ plus_constant (Pmode, base, -24)),
8);
break;
@@ -3190,7 +3191,8 @@ do_spill (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off,
add_reg_note (insn, REG_CFA_OFFSET,
gen_rtx_SET (VOIDmode,
gen_rtx_MEM (GET_MODE (reg),
- plus_constant (base, off)),
+ plus_constant (Pmode,
+ base, off)),
frame_reg));
}
}
@@ -4253,7 +4255,7 @@ ia64_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
m_tramp = adjust_automodify_address (m_tramp, VOIDmode, NULL, 8);
- emit_move_insn (m_tramp, force_reg (Pmode, plus_constant (addr, 16)));
+ emit_move_insn (m_tramp, force_reg (Pmode, plus_constant (Pmode, addr, 16)));
emit_insn (gen_adddi3 (addr_reg, addr_reg, eight));
m_tramp = adjust_automodify_address (m_tramp, VOIDmode, NULL, 8);
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 7d8630e6bbb..e75eb2f806a 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -1412,7 +1412,7 @@ iq2000_va_start (tree valist, rtx nextarg)
/* Everything is in the GPR save area, or in the overflow
area which is contiguous with it. */
- nextarg = plus_constant (nextarg, - gpr_save_area_size);
+ nextarg = plus_constant (Pmode, nextarg, - gpr_save_area_size);
std_expand_builtin_va_start (valist, nextarg);
}
@@ -1783,7 +1783,7 @@ iq2000_annotate_frame_insn (rtx insn, rtx dwarf_pattern)
static void
iq2000_emit_frame_related_store (rtx mem, rtx reg, HOST_WIDE_INT offset)
{
- rtx dwarf_address = plus_constant (stack_pointer_rtx, offset);
+ rtx dwarf_address = plus_constant (Pmode, stack_pointer_rtx, offset);
rtx dwarf_mem = gen_rtx_MEM (GET_MODE (reg), dwarf_address);
iq2000_annotate_frame_insn (emit_move_insn (mem, reg),
@@ -2031,7 +2031,8 @@ iq2000_expand_prologue (void)
adjustment_rtx));
dwarf_pattern = gen_rtx_SET (Pmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -tsize));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -tsize));
iq2000_annotate_frame_insn (insn, dwarf_pattern);
@@ -2120,7 +2121,7 @@ iq2000_expand_eh_return (rtx address)
HOST_WIDE_INT gp_offset = cfun->machine->gp_sp_offset;
rtx scratch;
- scratch = plus_constant (stack_pointer_rtx, gp_offset);
+ scratch = plus_constant (Pmode, stack_pointer_rtx, gp_offset);
emit_move_insn (gen_rtx_MEM (GET_MODE (address), scratch), address);
}
@@ -2873,9 +2874,9 @@ iq2000_setup_incoming_varargs (cumulative_args_t cum_v,
if (cum->arg_words < MAX_ARGS_IN_REGISTERS - iq2000_off)
{
rtx ptr, mem;
- ptr = plus_constant (virtual_incoming_args_rtx,
- - (iq2000_save_gp_regs
- * UNITS_PER_WORD));
+ ptr = plus_constant (Pmode, virtual_incoming_args_rtx,
+ - (iq2000_save_gp_regs
+ * UNITS_PER_WORD));
mem = gen_rtx_MEM (BLKmode, ptr);
move_block_from_reg
(cum->arg_words + GP_ARG_FIRST + iq2000_off,
@@ -3165,7 +3166,7 @@ iq2000_print_operand (FILE *file, rtx op, int letter)
else if (code == MEM)
{
if (letter == 'D')
- output_address (plus_constant (XEXP (op, 0), 4));
+ output_address (plus_constant (Pmode, XEXP (op, 0), 4));
else
output_address (XEXP (op, 0));
}
@@ -3273,7 +3274,7 @@ iq2000_legitimize_address (rtx xinsn, rtx old_x ATTRIBUTE_UNUSED,
ptr_reg,
gen_rtx_PLUS (Pmode, xplus0, int_reg)));
- return plus_constant (ptr_reg, INTVAL (xplus1) & 0x7fff);
+ return plus_constant (Pmode, ptr_reg, INTVAL (xplus1) & 0x7fff);
}
}
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index 0d0ee5f9a9e..2e1cf445428 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -715,7 +715,7 @@ lm32_setup_incoming_varargs (cumulative_args_t cum_v, enum machine_mode mode,
rtx regblock;
regblock = gen_rtx_MEM (BLKmode,
- plus_constant (arg_pointer_rtx,
+ plus_constant (Pmode, arg_pointer_rtx,
FIRST_PARM_OFFSET (0)));
move_block_from_reg (first_reg_offset, regblock, size);
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 57586474d9c..79b03fa0650 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -1178,7 +1178,8 @@ m32c_return_addr_rtx (int count)
}
ra_mem =
- gen_rtx_MEM (mode, plus_constant (gen_rtx_REG (Pmode, FP_REGNO), offset));
+ gen_rtx_MEM (mode, plus_constant (Pmode, gen_rtx_REG (Pmode, FP_REGNO),
+ offset));
return copy_to_mode_reg (mode, ra_mem);
}
@@ -4178,7 +4179,8 @@ m32c_expand_insv (rtx *operands)
&& GET_CODE (op0) == MEM)
{
/* We are little endian. */
- rtx new_mem = gen_rtx_MEM (QImode, plus_constant (XEXP (op0, 0), 1));
+ rtx new_mem = gen_rtx_MEM (QImode, plus_constant (Pmode,
+ XEXP (op0, 0), 1));
MEM_COPY_ATTRIBUTES (new_mem, op0);
mask >>= 8;
}
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 97636703602..b27a3a5bb89 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1293,7 +1293,7 @@ m32r_setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
rtx regblock;
regblock = gen_frame_mem (BLKmode,
- plus_constant (arg_pointer_rtx,
+ plus_constant (Pmode, arg_pointer_rtx,
FIRST_PARM_OFFSET (0)));
set_mem_alias_set (regblock, get_varargs_alias_set ());
move_block_from_reg (first_reg_offset, regblock, size);
@@ -1984,7 +1984,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
if (CONST_INT_P (offset))
{
if (INT16_P (INTVAL (offset)))
- return plus_constant (base, INTVAL (offset));
+ return plus_constant (Pmode, base, INTVAL (offset));
else
{
gcc_assert (! reload_in_progress && ! reload_completed);
@@ -2087,9 +2087,9 @@ m32r_print_operand (FILE * file, rtx x, int code)
currently necessary, but keep it around. */
if (GET_CODE (XEXP (x, 0)) == PRE_INC
|| GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 4));
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0), 4));
else
- output_address (plus_constant (XEXP (x, 0), 4));
+ output_address (plus_constant (Pmode, XEXP (x, 0), 4));
fputc (')', file);
}
else
@@ -2327,7 +2327,8 @@ m32r_print_operand_address (FILE * file, rtx addr)
fputs ("sda(", file);
else
fputs ("low(", file);
- output_addr_const (file, plus_constant (XEXP (base, 1), offset));
+ output_addr_const (file, plus_constant (Pmode, XEXP (base, 1),
+ offset));
fputs ("),", file);
fputs (reg_names[REGNO (XEXP (base, 0))], file);
}
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 325faf73a75..8f5b5057bf9 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -190,7 +190,8 @@ along with GCC; see the file COPYING3. If not see
#define FINALIZE_TRAMPOLINE(TRAMP) \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \
- plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode);
+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \
+ Pmode);
/* Clear the instruction cache from `beg' to `end'. This makes an
inline system call to SYS_cacheflush. The arguments are as
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 6fbd7001666..8b21419bd31 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -916,16 +916,17 @@ m68k_emit_movem (rtx base, HOST_WIDE_INT offset,
if (adjust_stack_p)
{
- src = plus_constant (base, (count
- * GET_MODE_SIZE (mode)
- * (HOST_WIDE_INT) (store_p ? -1 : 1)));
+ src = plus_constant (Pmode, base,
+ (count
+ * GET_MODE_SIZE (mode)
+ * (HOST_WIDE_INT) (store_p ? -1 : 1)));
XVECEXP (body, 0, i++) = gen_rtx_SET (VOIDmode, base, src);
}
for (; mask != 0; mask >>= 1, regno++)
if (mask & 1)
{
- addr = plus_constant (base, offset);
+ addr = plus_constant (Pmode, base, offset);
operands[!store_p] = gen_frame_mem (mode, addr);
operands[store_p] = gen_rtx_REG (mode, regno);
XVECEXP (body, 0, i++)
@@ -971,7 +972,7 @@ m68k_expand_prologue (void)
if (crtl->limit_stack
&& GET_CODE (stack_limit_rtx) == SYMBOL_REF)
{
- limit = plus_constant (stack_limit_rtx, current_frame.size + 4);
+ limit = plus_constant (Pmode, stack_limit_rtx, current_frame.size + 4);
if (!m68k_legitimate_constant_p (Pmode, limit))
{
emit_move_insn (gen_rtx_REG (Pmode, D0_REG), limit);
@@ -1205,12 +1206,12 @@ m68k_expand_epilogue (bool sibcall_p)
/* Generate the address -OFFSET(%fp,%a1.l). */
addr = gen_rtx_REG (Pmode, A1_REG);
addr = gen_rtx_PLUS (Pmode, addr, frame_pointer_rtx);
- addr = plus_constant (addr, -offset);
+ addr = plus_constant (Pmode, addr, -offset);
}
else if (restore_from_sp)
addr = gen_rtx_POST_INC (Pmode, stack_pointer_rtx);
else
- addr = plus_constant (frame_pointer_rtx, -offset);
+ addr = plus_constant (Pmode, frame_pointer_rtx, -offset);
emit_move_insn (gen_rtx_REG (SImode, D0_REG + i),
gen_frame_mem (SImode, addr));
offset -= GET_MODE_SIZE (SImode);
@@ -2450,7 +2451,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
base == reg ? 0 : reg);
if (GET_CODE (orig) == CONST_INT)
- pic_ref = plus_constant (base, INTVAL (orig));
+ pic_ref = plus_constant (Pmode, base, INTVAL (orig));
else
pic_ref = gen_rtx_PLUS (Pmode, base, orig);
}
@@ -5035,7 +5036,8 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
reload_completed = 1;
/* The "this" pointer is stored at 4(%sp). */
- this_slot = gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, 4));
+ this_slot = gen_rtx_MEM (Pmode, plus_constant (Pmode,
+ stack_pointer_rtx, 4));
/* Add DELTA to THIS. */
if (delta != 0)
@@ -5060,7 +5062,7 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
emit_move_insn (tmp, gen_rtx_MEM (Pmode, tmp));
/* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */
- addr = plus_constant (tmp, vcall_offset);
+ addr = plus_constant (Pmode, tmp, vcall_offset);
if (!m68k_legitimate_address_p (Pmode, addr, true))
{
emit_insn (gen_rtx_SET (VOIDmode, tmp, addr));
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 42d377942e7..0a390d074d4 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -782,8 +782,9 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
/* After the prologue, RA is at 4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
- ? gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, UNITS_PER_WORD)) \
- : gen_rtx_MEM (Pmode, plus_constant (FRAME, UNITS_PER_WORD)))
+ ? gen_rtx_MEM (Pmode, plus_constant (Pmode, arg_pointer_rtx, \
+ UNITS_PER_WORD)) \
+ : gen_rtx_MEM (Pmode, plus_constant (Pmode, FRAME, UNITS_PER_WORD)))
/* We must not use the DBX register numbers for the DWARF 2 CFA column
numbers because that maps to numbers beyond FIRST_PSEUDO_REGISTER.
@@ -814,7 +815,7 @@ do { if (cc_prev_status.flags & CC_IN_68881) \
#define EH_RETURN_HANDLER_RTX \
gen_rtx_MEM (Pmode, \
gen_rtx_PLUS (Pmode, arg_pointer_rtx, \
- plus_constant (EH_RETURN_STACKADJ_RTX, \
+ plus_constant (Pmode, EH_RETURN_STACKADJ_RTX, \
UNITS_PER_WORD)))
/* Select a format to encode pointers in exception handling data. CODE
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 8104e75492b..cc59d45a3bc 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -2409,7 +2409,8 @@
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
operands[1] = gen_rtx_MEM (SImode,
- plus_constant (XEXP(operands[0], 0), -8));
+ plus_constant (Pmode,
+ XEXP(operands[0], 0), -8));
return "move%.l %0,%3\;add%.l %R2,%0\;addx%.l %2,%3\;move%.l %3,%1";
}
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
@@ -2907,7 +2908,8 @@
if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
operands[1]
- = gen_rtx_MEM (SImode, plus_constant (XEXP (operands[0], 0), -8));
+ = gen_rtx_MEM (SImode, plus_constant (Pmode,
+ XEXP (operands[0], 0), -8));
return "move%.l %0,%3\;sub%.l %R2,%0\;subx%.l %2,%3\;move%.l %3,%1";
}
else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
@@ -7264,7 +7266,8 @@
(match_operand:SI 1 "const_int_operand")))])]
"TARGET_68020 || INTVAL (operands[1]) >= -0x8004"
{
- operands[2] = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, -4));
+ operands[2] = gen_frame_mem (SImode,
+ plus_constant (Pmode, stack_pointer_rtx, -4));
})
(define_insn "*link"
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 82ae0cfe68b..9b8cf020ef3 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -2003,7 +2003,8 @@ mcore_expand_prolog (void)
{
emit_insn (gen_movsi
(gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, offset)),
+ plus_constant (Pmode, stack_pointer_rtx,
+ offset)),
gen_rtx_REG (SImode, rn)));
}
}
@@ -2038,7 +2039,8 @@ mcore_expand_prolog (void)
{
emit_insn (gen_movsi
(gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, offs)),
+ plus_constant (Pmode, stack_pointer_rtx,
+ offs)),
gen_rtx_REG (SImode, i)));
offs += 4;
}
@@ -2133,7 +2135,8 @@ mcore_expand_epilog (void)
emit_insn (gen_movsi
(gen_rtx_REG (SImode, i),
gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, offs))));
+ plus_constant (Pmode, stack_pointer_rtx,
+ offs))));
offs += 4;
}
}
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index c56a0c6aea1..805de2b2326 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -1408,8 +1408,8 @@
XVECEXP (operands[3], 0, i)
= gen_rtx_SET (VOIDmode,
gen_rtx_REG (SImode, regno + i),
- gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx,
- i * 4)));
+ gen_rtx_MEM (SImode, plus_constant (Pmode, stack_pointer_rtx,
+ i * 4)));
}")
(define_insn ""
@@ -1446,8 +1446,8 @@
for (i = 0; i < count; i++)
XVECEXP (operands[3], 0, i)
= gen_rtx_SET (VOIDmode,
- gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx,
- i * 4)),
+ gen_rtx_MEM (SImode, plus_constant (Pmode, stack_pointer_rtx,
+ i * 4)),
gen_rtx_REG (SImode, regno + i));
}")
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 4351702fa4b..edfff549e2a 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -2366,7 +2366,7 @@ mep_allocate_initial_value (rtx reg)
}
rss = cfun->machine->reg_save_slot[REGNO(reg)];
- return gen_rtx_MEM (SImode, plus_constant (arg_pointer_rtx, -rss));
+ return gen_rtx_MEM (SImode, plus_constant (Pmode, arg_pointer_rtx, -rss));
}
rtx
@@ -2844,7 +2844,8 @@ mep_expand_prologue (void)
ALLOCATE_INITIAL_VALUE. The moves emitted here can then be safely
deleted as dead. */
mem = gen_rtx_MEM (rmode,
- plus_constant (stack_pointer_rtx, sp_offset - rss));
+ plus_constant (Pmode, stack_pointer_rtx,
+ sp_offset - rss));
maybe_dead_p = rtx_equal_p (mem, has_hard_reg_initial_val (rmode, i));
if (GR_REGNO_P (i) || LOADABLE_CR_REGNO_P (i))
@@ -2855,7 +2856,8 @@ mep_expand_prologue (void)
int be = TARGET_BIG_ENDIAN ? 4 : 0;
mem = gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, sp_offset - rss + be));
+ plus_constant (Pmode, stack_pointer_rtx,
+ sp_offset - rss + be));
maybe_dead_move (gen_rtx_REG (SImode, REGSAVE_CONTROL_TEMP),
gen_rtx_REG (SImode, i),
@@ -2876,7 +2878,8 @@ mep_expand_prologue (void)
copy_rtx (mem),
gen_rtx_REG (rmode, i)));
mem = gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx, sp_offset - rss + (4-be)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ sp_offset - rss + (4-be)));
insn = maybe_dead_move (mem,
gen_rtx_REG (SImode, REGSAVE_CONTROL_TEMP+1),
maybe_dead_p);
@@ -3083,8 +3086,8 @@ mep_expand_epilogue (void)
if (GR_REGNO_P (i) || LOADABLE_CR_REGNO_P (i))
emit_move_insn (gen_rtx_REG (rmode, i),
gen_rtx_MEM (rmode,
- plus_constant (stack_pointer_rtx,
- sp_offset-rss)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ sp_offset - rss)));
else
{
if (i == LP_REGNO && !mep_sibcall_epilogue && !interrupt_handler)
@@ -3096,7 +3099,8 @@ mep_expand_epilogue (void)
{
emit_move_insn (gen_rtx_REG (rmode, REGSAVE_CONTROL_TEMP),
gen_rtx_MEM (rmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
sp_offset-rss)));
emit_move_insn (gen_rtx_REG (rmode, i),
gen_rtx_REG (rmode, REGSAVE_CONTROL_TEMP));
@@ -3109,7 +3113,7 @@ mep_expand_epilogue (void)
register when we return by jumping indirectly via the temp. */
emit_move_insn (gen_rtx_REG (SImode, REGSAVE_CONTROL_TEMP),
gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
lp_slot)));
lp_temp = REGSAVE_CONTROL_TEMP;
}
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index 8412d0ef127..b170606bc75 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -341,7 +341,8 @@ double_memory_operand (rtx op, enum machine_mode mode)
return 1;
return memory_address_p ((GET_MODE_CLASS (mode) == MODE_INT
- ? SImode : SFmode), plus_constant (addr, 4));
+ ? SImode : SFmode),
+ plus_constant (Pmode, addr, 4));
}
/* Implement REG_OK_FOR_BASE_P -and- REG_OK_FOR_INDEX_P. */
@@ -808,8 +809,8 @@ microblaze_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length)
microblaze_block_move_straight (dest, src, MAX_MOVE_BYTES);
/* Move on to the next block. */
- emit_move_insn (src_reg, plus_constant (src_reg, MAX_MOVE_BYTES));
- emit_move_insn (dest_reg, plus_constant (dest_reg, MAX_MOVE_BYTES));
+ emit_move_insn (src_reg, plus_constant (Pmode, src_reg, MAX_MOVE_BYTES));
+ emit_move_insn (dest_reg, plus_constant (Pmode, dest_reg, MAX_MOVE_BYTES));
/* Emit the test & branch. */
emit_insn (gen_cbranchsi4 (gen_rtx_NE (SImode, src_reg, final_src),
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index d48a46582b5..1e09f28d9a2 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -2569,7 +2569,7 @@ mips_strip_unspec_address (rtx op)
split_const (op, &base, &offset);
if (UNSPEC_ADDRESS_P (base))
- op = plus_constant (UNSPEC_ADDRESS (base), INTVAL (offset));
+ op = plus_constant (Pmode, UNSPEC_ADDRESS (base), INTVAL (offset));
return op;
}
@@ -2808,7 +2808,7 @@ mips_add_offset (rtx temp, rtx reg, HOST_WIDE_INT offset)
high = mips_force_temporary (temp, high);
reg = mips_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg));
}
- return plus_constant (reg, offset);
+ return plus_constant (Pmode, reg, offset);
}
/* The __tls_get_attr symbol. */
@@ -5392,7 +5392,7 @@ mips_setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
{
rtx ptr, mem;
- ptr = plus_constant (virtual_incoming_args_rtx,
+ ptr = plus_constant (Pmode, virtual_incoming_args_rtx,
REG_PARM_STACK_SPACE (cfun->decl)
- gp_saved * UNITS_PER_WORD);
mem = gen_frame_mem (BLKmode, ptr);
@@ -5421,7 +5421,7 @@ mips_setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
{
rtx ptr, mem;
- ptr = plus_constant (virtual_incoming_args_rtx, off);
+ ptr = plus_constant (Pmode, virtual_incoming_args_rtx, off);
mem = gen_frame_mem (mode, ptr);
set_mem_alias_set (mem, get_varargs_alias_set ());
mips_emit_move (mem, gen_rtx_REG (mode, FP_ARG_FIRST + i));
@@ -5584,7 +5584,7 @@ mips_va_start (tree valist, rtx nextarg)
}
else
{
- nextarg = plus_constant (nextarg, -cfun->machine->varargs_size);
+ nextarg = plus_constant (Pmode, nextarg, -cfun->machine->varargs_size);
std_expand_builtin_va_start (valist, nextarg);
}
}
@@ -6951,8 +6951,8 @@ mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length,
mips_block_move_straight (dest, src, bytes_per_iter);
/* Move on to the next block. */
- mips_emit_move (src_reg, plus_constant (src_reg, bytes_per_iter));
- mips_emit_move (dest_reg, plus_constant (dest_reg, bytes_per_iter));
+ mips_emit_move (src_reg, plus_constant (Pmode, src_reg, bytes_per_iter));
+ mips_emit_move (dest_reg, plus_constant (Pmode, dest_reg, bytes_per_iter));
/* Emit the loop condition. */
test = gen_rtx_NE (VOIDmode, src_reg, final_src);
@@ -7892,7 +7892,7 @@ mips_print_operand (FILE *file, rtx op, int letter)
case MEM:
if (letter == 'D')
- output_address (plus_constant (XEXP (op, 0), 4));
+ output_address (plus_constant (Pmode, XEXP (op, 0), 4));
else if (letter && letter != 'z')
output_operand_lossage ("invalid use of '%%%c'", letter);
else
@@ -8751,7 +8751,8 @@ mips16e_save_restore_reg (bool restore_p, bool reg_parm_p,
{
rtx reg, mem;
- mem = gen_frame_mem (SImode, plus_constant (stack_pointer_rtx, offset));
+ mem = gen_frame_mem (SImode, plus_constant (Pmode, stack_pointer_rtx,
+ offset));
reg = gen_rtx_REG (SImode, regno);
if (restore_p)
{
@@ -8810,7 +8811,7 @@ mips16e_build_save_restore (bool restore_p, unsigned int *mask_ptr,
/* Add the stack pointer adjustment. */
set = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
restore_p ? size : -size));
RTX_FRAME_RELATED_P (set) = 1;
XVECEXP (pattern, 0, n++) = set;
@@ -9951,7 +9952,8 @@ mips_save_restore_reg (enum machine_mode mode, int regno,
{
rtx mem;
- mem = gen_frame_mem (mode, plus_constant (stack_pointer_rtx, offset));
+ mem = gen_frame_mem (mode, plus_constant (Pmode, stack_pointer_rtx,
+ offset));
fn (gen_rtx_REG (mode, regno), mem);
}
@@ -10441,7 +10443,7 @@ mips_expand_prologue (void)
{
/* Push EPC into its stack slot. */
mem = gen_frame_mem (word_mode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
offset));
mips_emit_move (mem, gen_rtx_REG (word_mode, K1_REG_NUM));
offset -= UNITS_PER_WORD;
@@ -10460,7 +10462,8 @@ mips_expand_prologue (void)
/* Push Status into its stack slot. */
mem = gen_frame_mem (word_mode,
- plus_constant (stack_pointer_rtx, offset));
+ plus_constant (Pmode, stack_pointer_rtx,
+ offset));
mips_emit_move (mem, gen_rtx_REG (word_mode, K1_REG_NUM));
offset -= UNITS_PER_WORD;
@@ -10532,7 +10535,7 @@ mips_expand_prologue (void)
/* Describe the combined effect of the previous instructions. */
mips_set_frame_expr
(gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -size)));
+ plus_constant (Pmode, stack_pointer_rtx, -size)));
}
mips_frame_barrier ();
}
@@ -10563,7 +10566,7 @@ mips_expand_prologue (void)
MIPS_PROLOGUE_TEMP (Pmode)));
mips_set_frame_expr
(gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
- plus_constant (stack_pointer_rtx, offset)));
+ plus_constant (Pmode, stack_pointer_rtx, offset)));
}
}
@@ -10576,7 +10579,7 @@ mips_expand_prologue (void)
HOST_WIDE_INT offset;
mips_get_cprestore_base_and_offset (&base, &offset, false);
- mem = gen_frame_mem (Pmode, plus_constant (base, offset));
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, base, offset));
gp = TARGET_MIPS16 ? MIPS16_PIC_TEMP : pic_offset_table_rtx;
temp = (SMALL_OPERAND (offset)
? gen_rtx_SCRATCH (Pmode)
@@ -10585,7 +10588,7 @@ mips_expand_prologue (void)
(mem, GEN_INT (offset), gp, temp)));
mips_get_cprestore_base_and_offset (&base, &offset, true);
- mem = gen_frame_mem (Pmode, plus_constant (base, offset));
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, base, offset));
emit_insn (PMODE_INSN (gen_use_cprestore, (mem)));
}
@@ -10641,7 +10644,7 @@ mips_epilogue_set_cfa (rtx reg, HOST_WIDE_INT offset)
{
RTX_FRAME_RELATED_P (insn) = 1;
REG_NOTES (insn) = alloc_reg_note (REG_CFA_DEF_CFA,
- plus_constant (reg, offset),
+ plus_constant (Pmode, reg, offset),
REG_NOTES (insn));
mips_epilogue.cfa_reg = reg;
mips_epilogue.cfa_offset = offset;
@@ -10830,7 +10833,8 @@ mips_expand_epilogue (bool sibcall_p)
{
/* Restore the original EPC. */
mem = gen_frame_mem (word_mode,
- plus_constant (stack_pointer_rtx, offset));
+ plus_constant (Pmode, stack_pointer_rtx,
+ offset));
mips_emit_move (gen_rtx_REG (word_mode, K0_REG_NUM), mem);
offset -= UNITS_PER_WORD;
@@ -10841,7 +10845,8 @@ mips_expand_epilogue (bool sibcall_p)
/* Restore the original Status. */
mem = gen_frame_mem (word_mode,
- plus_constant (stack_pointer_rtx, offset));
+ plus_constant (Pmode, stack_pointer_rtx,
+ offset));
mips_emit_move (gen_rtx_REG (word_mode, K0_REG_NUM), mem);
offset -= UNITS_PER_WORD;
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 5d8f74f5e79..912dccb5ee0 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -5756,7 +5756,7 @@
{
rtx addr;
- addr = plus_constant (operands[0], GET_MODE_SIZE (Pmode) * 3);
+ addr = plus_constant (Pmode, operands[0], GET_MODE_SIZE (Pmode) * 3);
mips_emit_move (gen_rtx_MEM (Pmode, addr), pic_offset_table_rtx);
DONE;
})
@@ -5772,9 +5772,9 @@
/* The elements of the buffer are, in order: */
int W = GET_MODE_SIZE (Pmode);
rtx fp = gen_rtx_MEM (Pmode, operands[0]);
- rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], 1*W));
- rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2*W));
- rtx gpv = gen_rtx_MEM (Pmode, plus_constant (operands[0], 3*W));
+ rtx lab = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0], 1*W));
+ rtx stack = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0], 2*W));
+ rtx gpv = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0], 3*W));
rtx pv = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
/* Use gen_raw_REG to avoid being given pic_offset_table_rtx.
The target is bound to be using $28 as the global pointer
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index c87d09e0e2f..8f801e6c7ca 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -550,7 +550,7 @@ mmix_dynamic_chain_address (rtx frame)
frame-pointer. Unfortunately, the caller assumes that a
frame-pointer is present for *all* previous frames. There should be
a way to say that that cannot be done, like for RETURN_ADDR_RTX. */
- return plus_constant (frame, -8);
+ return plus_constant (Pmode, frame, -8);
}
/* STARTING_FRAME_OFFSET. */
@@ -581,7 +581,9 @@ mmix_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED)
See mmix_initial_elimination_offset for the reason we can't use
get_hard_reg_initial_val for both. Always using a stack slot
and not a register would be suboptimal. */
- ? validize_mem (gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx, -16)))
+ ? validize_mem (gen_rtx_MEM (Pmode,
+ plus_constant (Pmode,
+ frame_pointer_rtx, -16)))
: get_hard_reg_initial_val (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM))
: NULL_RTX;
}
@@ -2063,7 +2065,7 @@ mmix_expand_prologue (void)
/* These registers aren't actually saved (as in "will be
restored"), so don't tell DWARF2 they're saved. */
emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
offset)),
gen_rtx_REG (DImode, regno));
offset -= 8;
@@ -2090,7 +2092,8 @@ mmix_expand_prologue (void)
}
insn = emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
hard_frame_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -2132,14 +2135,16 @@ mmix_expand_prologue (void)
emit_move_insn (tmpreg, retreg);
insn = emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
tmpreg);
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode,
gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
retreg));
@@ -2179,7 +2184,8 @@ mmix_expand_prologue (void)
gen_rtx_REG (DImode,
MMIX_rO_REGNUM));
emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx, offset)),
+ plus_constant (Pmode, stack_pointer_rtx,
+ offset)),
gen_rtx_REG (DImode, 255));
offset -= 8;
}
@@ -2215,7 +2221,8 @@ mmix_expand_prologue (void)
}
insn = emit_move_insn (gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
gen_rtx_REG (DImode, regno));
RTX_FRAME_RELATED_P (insn) = 1;
@@ -2291,7 +2298,7 @@ mmix_expand_epilogue (void)
emit_move_insn (gen_rtx_REG (DImode, regno),
gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
offset)));
offset += 8;
}
@@ -2323,7 +2330,7 @@ mmix_expand_epilogue (void)
emit_move_insn (hard_frame_pointer_rtx,
gen_rtx_MEM (DImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
offset)));
offset += 8;
}
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index b5f3933c26e..1554f94644c 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -711,7 +711,7 @@ mn10300_gen_multiple_store (unsigned int mask)
continue;
++count;
- x = plus_constant (stack_pointer_rtx, count * -4);
+ x = plus_constant (Pmode, stack_pointer_rtx, count * -4);
x = gen_frame_mem (SImode, x);
x = gen_rtx_SET (VOIDmode, x, gen_rtx_REG (SImode, regno));
elts[count] = F(x);
@@ -725,7 +725,7 @@ mn10300_gen_multiple_store (unsigned int mask)
gcc_assert (mask == 0);
/* Create the instruction that updates the stack pointer. */
- x = plus_constant (stack_pointer_rtx, count * -4);
+ x = plus_constant (Pmode, stack_pointer_rtx, count * -4);
x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
elts[0] = F(x);
@@ -1464,7 +1464,7 @@ mn10300_builtin_saveregs (void)
alias_set_type set = get_varargs_alias_set ();
if (argadj)
- offset = plus_constant (crtl->args.arg_offset_rtx, argadj);
+ offset = plus_constant (Pmode, crtl->args.arg_offset_rtx, argadj);
else
offset = crtl->args.arg_offset_rtx;
@@ -1473,7 +1473,8 @@ mn10300_builtin_saveregs (void)
emit_move_insn (mem, gen_rtx_REG (SImode, 0));
mem = gen_rtx_MEM (SImode,
- plus_constant (crtl->args.internal_arg_pointer, 4));
+ plus_constant (Pmode,
+ crtl->args.internal_arg_pointer, 4));
set_mem_alias_set (mem, set);
emit_move_insn (mem, gen_rtx_REG (SImode, 1));
@@ -2516,7 +2517,7 @@ mn10300_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
clobber the flags but do not affect the contents of D0 or D1. */
disp = expand_binop (SImode, sub_optab, fnaddr,
- plus_constant (XEXP (m_tramp, 0), 11),
+ plus_constant (Pmode, XEXP (m_tramp, 0), 11),
NULL_RTX, 1, OPTAB_DIRECT);
mem = adjust_address (m_tramp, SImode, 0);
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index d70eaac3015..8d40412d095 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -504,9 +504,9 @@ moxie_static_chain (const_tree fndecl, bool incoming_p)
return NULL;
if (incoming_p)
- addr = plus_constant (arg_pointer_rtx, 2 * UNITS_PER_WORD);
+ addr = plus_constant (Pmode, arg_pointer_rtx, 2 * UNITS_PER_WORD);
else
- addr = plus_constant (stack_pointer_rtx, -UNITS_PER_WORD);
+ addr = plus_constant (Pmode, stack_pointer_rtx, -UNITS_PER_WORD);
mem = gen_rtx_MEM (Pmode, addr);
MEM_NOTRAP_P (mem) = 1;
diff --git a/gcc/config/moxie/moxie.h b/gcc/config/moxie/moxie.h
index d2a455b289c..c80d26c5ae9 100644
--- a/gcc/config/moxie/moxie.h
+++ b/gcc/config/moxie/moxie.h
@@ -278,7 +278,7 @@ enum reg_class
the prologue. */
#define INCOMING_RETURN_ADDR_RTX \
gen_frame_mem (Pmode, \
- plus_constant (stack_pointer_rtx, UNITS_PER_WORD))
+ plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD))
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N+2) : INVALID_REGNUM)
@@ -286,7 +286,7 @@ enum reg_class
/* Store the return handler into the call frame. */
#define EH_RETURN_HANDLER_RTX \
gen_frame_mem (Pmode, \
- plus_constant (frame_pointer_rtx, UNITS_PER_WORD))
+ plus_constant (Pmode, frame_pointer_rtx, UNITS_PER_WORD))
/* Storage Layout */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 6b4ea25fa22..56c889db88c 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -863,7 +863,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
if (GET_CODE (orig) == CONST_INT)
{
if (INT_14_BITS (orig))
- return plus_constant (base, INTVAL (orig));
+ return plus_constant (Pmode, base, INTVAL (orig));
orig = force_reg (Pmode, orig);
}
pic_ref = gen_rtx_PLUS (Pmode, base, orig);
@@ -1073,7 +1073,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
if (! VAL_14_BITS_P (newoffset)
&& GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
{
- rtx const_part = plus_constant (XEXP (x, 0), newoffset);
+ rtx const_part = plus_constant (Pmode, XEXP (x, 0), newoffset);
rtx tmp_reg
= force_reg (Pmode,
gen_rtx_HIGH (Pmode, const_part));
@@ -1094,7 +1094,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
force_reg (Pmode, XEXP (x, 0)),
int_part));
}
- return plus_constant (ptr_reg, offset - newoffset);
+ return plus_constant (Pmode, ptr_reg, offset - newoffset);
}
/* Handle (plus (mult (a) (shadd_constant)) (b)). */
@@ -3484,7 +3484,7 @@ store_reg (int reg, HOST_WIDE_INT disp, int base)
basereg = gen_rtx_REG (Pmode, base);
if (VAL_14_BITS_P (disp))
{
- dest = gen_rtx_MEM (word_mode, plus_constant (basereg, disp));
+ dest = gen_rtx_MEM (word_mode, plus_constant (Pmode, basereg, disp));
insn = emit_move_insn (dest, src);
}
else if (TARGET_64BIT && !VAL_32_BITS_P (disp))
@@ -3568,7 +3568,8 @@ set_reg_plus_d (int reg, int base, HOST_WIDE_INT disp, int note)
if (VAL_14_BITS_P (disp))
{
insn = emit_move_insn (gen_rtx_REG (Pmode, reg),
- plus_constant (gen_rtx_REG (Pmode, base), disp));
+ plus_constant (Pmode,
+ gen_rtx_REG (Pmode, base), disp));
}
else if (TARGET_64BIT && !VAL_32_BITS_P (disp))
{
@@ -4007,16 +4008,19 @@ pa_expand_prologue (void)
if (TARGET_64BIT)
{
rtx mem = gen_rtx_MEM (DFmode,
- plus_constant (base, offset));
+ plus_constant (Pmode, base,
+ offset));
add_reg_note (insn, REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, mem, reg));
}
else
{
rtx meml = gen_rtx_MEM (SFmode,
- plus_constant (base, offset));
+ plus_constant (Pmode, base,
+ offset));
rtx memr = gen_rtx_MEM (SFmode,
- plus_constant (base, offset + 4));
+ plus_constant (Pmode, base,
+ offset + 4));
rtx regl = gen_rtx_REG (SFmode, i);
rtx regr = gen_rtx_REG (SFmode, i + 1);
rtx setl = gen_rtx_SET (VOIDmode, meml, regl);
@@ -4048,7 +4052,7 @@ load_reg (int reg, HOST_WIDE_INT disp, int base)
rtx src;
if (VAL_14_BITS_P (disp))
- src = gen_rtx_MEM (word_mode, plus_constant (basereg, disp));
+ src = gen_rtx_MEM (word_mode, plus_constant (Pmode, basereg, disp));
else if (TARGET_64BIT && !VAL_32_BITS_P (disp))
{
rtx delta = GEN_INT (disp);
@@ -4562,7 +4566,7 @@ pa_return_addr_rtx (int count, rtx frameaddr)
for (i = 0; i < len; i++)
{
- rtx op0 = gen_rtx_MEM (SImode, plus_constant (ins, i * 4));
+ rtx op0 = gen_rtx_MEM (SImode, plus_constant (Pmode, ins, i * 4));
rtx op1 = GEN_INT (insns[i]);
emit_cmp_and_jump_insns (op0, op1, NE, NULL, SImode, 0, label);
}
@@ -4575,7 +4579,7 @@ pa_return_addr_rtx (int count, rtx frameaddr)
emit_move_insn (saved_rp,
gen_rtx_MEM (Pmode,
memory_address (Pmode,
- plus_constant (frameaddr,
+ plus_constant (Pmode, frameaddr,
-24))));
emit_label (label);
@@ -6080,7 +6084,7 @@ hppa_builtin_saveregs (void)
? UNITS_PER_WORD : 0);
if (argadj)
- offset = plus_constant (crtl->args.arg_offset_rtx, argadj);
+ offset = plus_constant (Pmode, crtl->args.arg_offset_rtx, argadj);
else
offset = crtl->args.arg_offset_rtx;
@@ -6090,7 +6094,7 @@ hppa_builtin_saveregs (void)
/* Adjust for varargs/stdarg differences. */
if (argadj)
- offset = plus_constant (crtl->args.arg_offset_rtx, -argadj);
+ offset = plus_constant (Pmode, crtl->args.arg_offset_rtx, -argadj);
else
offset = crtl->args.arg_offset_rtx;
@@ -6098,7 +6102,8 @@ hppa_builtin_saveregs (void)
from the incoming arg pointer and growing to larger addresses. */
for (i = 26, off = -64; i >= 19; i--, off += 8)
emit_move_insn (gen_rtx_MEM (word_mode,
- plus_constant (arg_pointer_rtx, off)),
+ plus_constant (Pmode,
+ arg_pointer_rtx, off)),
gen_rtx_REG (word_mode, i));
/* The incoming args pointer points just beyond the flushback area;
@@ -6106,7 +6111,7 @@ hppa_builtin_saveregs (void)
varargs/stdargs we want to make the arg pointer point to the start
of the incoming argument area. */
emit_move_insn (virtual_incoming_args_rtx,
- plus_constant (arg_pointer_rtx, -64));
+ plus_constant (Pmode, arg_pointer_rtx, -64));
/* Now return a pointer to the first anonymous argument. */
return copy_to_reg (expand_binop (Pmode, add_optab,
@@ -6116,7 +6121,7 @@ hppa_builtin_saveregs (void)
/* Store general registers on the stack. */
dest = gen_rtx_MEM (BLKmode,
- plus_constant (crtl->args.internal_arg_pointer,
+ plus_constant (Pmode, crtl->args.internal_arg_pointer,
-16));
set_mem_alias_set (dest, get_varargs_alias_set ());
set_mem_align (dest, BITS_PER_WORD);
@@ -10126,7 +10131,8 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
cache lines to minimize the number of lines flushed. */
emit_insn (gen_andsi3 (start_addr, r_tramp,
GEN_INT (-MIN_CACHELINE_SIZE)));
- tmp = force_reg (Pmode, plus_constant (r_tramp, TRAMPOLINE_CODE_SIZE-1));
+ tmp = force_reg (Pmode, plus_constant (Pmode, r_tramp,
+ TRAMPOLINE_CODE_SIZE-1));
emit_insn (gen_andsi3 (end_addr, tmp,
GEN_INT (-MIN_CACHELINE_SIZE)));
emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
@@ -10144,7 +10150,8 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
/* Create a fat pointer for the trampoline. */
tmp = adjust_address (m_tramp, Pmode, 16);
- emit_move_insn (tmp, force_reg (Pmode, plus_constant (r_tramp, 32)));
+ emit_move_insn (tmp, force_reg (Pmode, plus_constant (Pmode,
+ r_tramp, 32)));
tmp = adjust_address (m_tramp, Pmode, 24);
emit_move_insn (tmp, gen_rtx_REG (Pmode, 27));
@@ -10152,10 +10159,11 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
they do not accept integer displacements. We align the
start and end addresses to the beginning of their respective
cache lines to minimize the number of lines flushed. */
- tmp = force_reg (Pmode, plus_constant (r_tramp, 32));
+ tmp = force_reg (Pmode, plus_constant (Pmode, r_tramp, 32));
emit_insn (gen_anddi3 (start_addr, tmp,
GEN_INT (-MIN_CACHELINE_SIZE)));
- tmp = force_reg (Pmode, plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1));
+ tmp = force_reg (Pmode, plus_constant (Pmode, tmp,
+ TRAMPOLINE_CODE_SIZE - 1));
emit_insn (gen_anddi3 (end_addr, tmp,
GEN_INT (-MIN_CACHELINE_SIZE)));
emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
@@ -10174,7 +10182,7 @@ static rtx
pa_trampoline_adjust_address (rtx addr)
{
if (!TARGET_64BIT)
- addr = memory_address (Pmode, plus_constant (addr, 46));
+ addr = memory_address (Pmode, plus_constant (Pmode, addr, 46));
return addr;
}
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index a69f2b8a365..d0110e79868 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -6870,7 +6870,7 @@
of the virtual stack variables and the hard frame pointer. */
if (GET_CODE (fp) != REG)
fp = force_reg (Pmode, fp);
- emit_move_insn (hard_frame_pointer_rtx, plus_constant (fp, -8));
+ emit_move_insn (hard_frame_pointer_rtx, plus_constant (Pmode, fp, -8));
emit_stack_restore (SAVE_NONLOCAL, stack);
@@ -8300,9 +8300,9 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
{
/* The elements of the buffer are, in order: */
rtx fp = gen_rtx_MEM (Pmode, operands[0]);
- rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0],
+ rtx lab = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0],
POINTER_SIZE / BITS_PER_UNIT));
- rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0],
+ rtx stack = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0],
(POINTER_SIZE * 2) / BITS_PER_UNIT));
rtx pv = gen_rtx_REG (Pmode, 1);
@@ -8314,7 +8314,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
to adjust for the offset between these two values. */
if (GET_CODE (fp) != REG)
fp = force_reg (Pmode, fp);
- emit_move_insn (hard_frame_pointer_rtx, plus_constant (fp, -8));
+ emit_move_insn (hard_frame_pointer_rtx, plus_constant (Pmode, fp, -8));
/* This bit is the same as expand_builtin_longjmp. */
emit_stack_restore (SAVE_NONLOCAL, stack);
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 42e3af078db..85ea46abfa7 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -389,7 +389,7 @@ pdp11_expand_epilogue (void)
for (regno = AC5_REGNUM; regno >= AC0_REGNUM; regno--)
if (pdp11_saved_regno (regno))
{
- x = plus_constant (hard_frame_pointer_rtx, ofs);
+ x = plus_constant (Pmode, hard_frame_pointer_rtx, ofs);
x = gen_frame_mem (DFmode, x);
reg = gen_rtx_REG (DFmode, regno);
@@ -407,7 +407,7 @@ pdp11_expand_epilogue (void)
if (pdp11_saved_regno (regno)
&& (regno != HARD_FRAME_POINTER_REGNUM || !frame_pointer_needed))
{
- x = plus_constant (hard_frame_pointer_rtx, ofs);
+ x = plus_constant (Pmode, hard_frame_pointer_rtx, ofs);
x = gen_frame_mem (Pmode, x);
emit_move_insn (gen_rtx_REG (Pmode, regno), x);
ofs += 2;
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index b878a1f1777..57cbd157f41 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -4696,6 +4696,6 @@ picochip_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
if (incoming_p)
addr = arg_pointer_rtx;
else
- addr = plus_constant (stack_pointer_rtx, -2 * UNITS_PER_WORD);
+ addr = plus_constant (Pmode, stack_pointer_rtx, -2 * UNITS_PER_WORD);
return gen_frame_mem (Pmode, addr);
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index dca434b1945..9b6d898dfb4 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5594,7 +5594,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
high_int = INTVAL (XEXP (x, 1)) - low_int;
sum = force_operand (gen_rtx_PLUS (Pmode, XEXP (x, 0),
GEN_INT (high_int)), 0);
- return plus_constant (sum, low_int);
+ return plus_constant (Pmode, sum, low_int);
}
else if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == REG
@@ -8951,7 +8951,7 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
}
cfun->machine->varargs_save_offset = offset;
- save_area = plus_constant (virtual_stack_vars_rtx, offset);
+ save_area = plus_constant (Pmode, virtual_stack_vars_rtx, offset);
}
}
else
@@ -8983,7 +8983,7 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
}
mem = gen_rtx_MEM (BLKmode,
- plus_constant (save_area,
+ plus_constant (Pmode, save_area,
first_reg_offset * reg_size));
MEM_NOTRAP_P (mem) = 1;
set_mem_alias_set (mem, set);
@@ -9021,7 +9021,7 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
{
mem = gen_rtx_MEM ((TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT)
? DFmode : SFmode,
- plus_constant (save_area, off));
+ plus_constant (Pmode, save_area, off));
MEM_NOTRAP_P (mem) = 1;
set_mem_alias_set (mem, set);
set_mem_align (mem, GET_MODE_ALIGNMENT (
@@ -14832,10 +14832,10 @@ print_operand (FILE *file, rtx x, int code)
we have already done it, we can just use an offset of word. */
if (GET_CODE (XEXP (x, 0)) == PRE_INC
|| GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0),
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0),
UNITS_PER_WORD));
else if (GET_CODE (XEXP (x, 0)) == PRE_MODIFY)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0),
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0),
UNITS_PER_WORD));
else
output_address (XEXP (adjust_address_nv (x, SImode,
@@ -15159,9 +15159,9 @@ print_operand (FILE *file, rtx x, int code)
{
if (GET_CODE (XEXP (x, 0)) == PRE_INC
|| GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 8));
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0), 8));
else if (GET_CODE (XEXP (x, 0)) == PRE_MODIFY)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 8));
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0), 8));
else
output_address (XEXP (adjust_address_nv (x, SImode, 8), 0));
if (small_data_operand (x, GET_MODE (x)))
@@ -15209,9 +15209,9 @@ print_operand (FILE *file, rtx x, int code)
{
if (GET_CODE (XEXP (x, 0)) == PRE_INC
|| GET_CODE (XEXP (x, 0)) == PRE_DEC)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 12));
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0), 12));
else if (GET_CODE (XEXP (x, 0)) == PRE_MODIFY)
- output_address (plus_constant (XEXP (XEXP (x, 0), 0), 12));
+ output_address (plus_constant (Pmode, XEXP (XEXP (x, 0), 0), 12));
else
output_address (XEXP (adjust_address_nv (x, SImode, 12), 0));
if (small_data_operand (x, GET_MODE (x)))
@@ -18161,7 +18161,8 @@ rs6000_return_addr (int count, rtx frame)
(Pmode,
memory_address
(Pmode,
- plus_constant (copy_to_reg
+ plus_constant (Pmode,
+ copy_to_reg
(gen_rtx_MEM (Pmode,
memory_address (Pmode, frame))),
RETURN_ADDRESS_OFFSET)));
@@ -18431,7 +18432,8 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch)
else if (info->push_p)
sp_offset = info->total_size;
- tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset);
+ tmp = plus_constant (Pmode, frame_rtx,
+ info->lr_save_offset + sp_offset);
tmp = gen_frame_mem (Pmode, tmp);
emit_move_insn (tmp, operands[0]);
}
@@ -18679,9 +18681,11 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
it exceeds SIZE. If only one probe is needed, this will not
generate any code. Then probe at FIRST + SIZE. */
for (i = PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
- emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + i)));
+ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
+ -(first + i)));
- emit_stack_probe (plus_constant (stack_pointer_rtx, -(first + size)));
+ emit_stack_probe (plus_constant (Pmode, stack_pointer_rtx,
+ -(first + size)));
}
/* Otherwise, do the same as above, but in a loop. Note that we must be
@@ -18707,7 +18711,8 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
/* TEST_ADDR = SP + FIRST. */
emit_insn (gen_rtx_SET (VOIDmode, r12,
- plus_constant (stack_pointer_rtx, -first)));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -first)));
/* LAST_ADDR = SP + FIRST + ROUNDED_SIZE. */
if (rounded_size > 32768)
@@ -18718,7 +18723,7 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
}
else
emit_insn (gen_rtx_SET (VOIDmode, r0,
- plus_constant (r12, -rounded_size)));
+ plus_constant (Pmode, r12, -rounded_size)));
/* Step 3: the loop
@@ -18742,7 +18747,7 @@ rs6000_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
that SIZE is equal to ROUNDED_SIZE. */
if (size != rounded_size)
- emit_stack_probe (plus_constant (r12, rounded_size - size));
+ emit_stack_probe (plus_constant (Pmode, r12, rounded_size - size));
}
}
@@ -21111,7 +21116,7 @@ rs6000_emit_epilogue (int sibcall)
{
insn = get_last_insn ();
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (frame_reg_rtx, frame_off));
+ plus_constant (Pmode, frame_reg_rtx, frame_off));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -25176,7 +25181,7 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode,
if (GET_CODE (offset) == CONST_INT)
{
if (SMALL_INT (offset))
- return plus_constant (base, INTVAL (offset));
+ return plus_constant (Pmode, base, INTVAL (offset));
else if (! reload_in_progress && ! reload_completed)
offset = force_reg (Pmode, offset);
else
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 561c623d44f..c69a209fc8a 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1394,7 +1394,7 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX];
/* MEM representing address to save the TOC register */
#define RS6000_SAVE_TOC gen_rtx_MEM (Pmode, \
- plus_constant (stack_pointer_rtx, \
+ plus_constant (Pmode, stack_pointer_rtx, \
(TARGET_32BIT ? 20 : 40)))
/* Align an address */
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index e7483e9611d..016c34827ce 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -1779,7 +1779,7 @@ gen_rx_rtsd_vector (unsigned int adjust, unsigned int low, unsigned int high)
XVECEXP (vector, 0, 0) =
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, adjust));
+ plus_constant (Pmode, stack_pointer_rtx, adjust));
for (i = 0; i < count - 2; i++)
XVECEXP (vector, 0, i + 1) =
@@ -1787,7 +1787,7 @@ gen_rx_rtsd_vector (unsigned int adjust, unsigned int low, unsigned int high)
gen_rtx_REG (SImode, low + i),
gen_rtx_MEM (SImode,
i == 0 ? stack_pointer_rtx
- : plus_constant (stack_pointer_rtx,
+ : plus_constant (Pmode, stack_pointer_rtx,
i * UNITS_PER_WORD)));
XVECEXP (vector, 0, count - 1) = ret_rtx;
@@ -1808,7 +1808,7 @@ gen_rx_popm_vector (unsigned int low, unsigned int high)
XVECEXP (vector, 0, 0) =
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
(count - 1) * UNITS_PER_WORD));
for (i = 0; i < count - 1; i++)
@@ -1817,7 +1817,7 @@ gen_rx_popm_vector (unsigned int low, unsigned int high)
gen_rtx_REG (SImode, low + i),
gen_rtx_MEM (SImode,
i == 0 ? stack_pointer_rtx
- : plus_constant (stack_pointer_rtx,
+ : plus_constant (Pmode, stack_pointer_rtx,
i * UNITS_PER_WORD)));
return vector;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 5592674e857..b338cd96136 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1994,7 +1994,7 @@ s390_decompose_address (rtx addr, struct s390_address *out)
if (offset >= GET_MODE_SIZE (get_pool_mode (sym)))
return false;
- orig_disp = plus_constant (orig_disp, offset);
+ orig_disp = plus_constant (Pmode, orig_disp, offset);
}
}
@@ -3564,7 +3564,7 @@ legitimize_pic_address (rtx orig, rtx reg)
new_rtx = legitimize_pic_address (XEXP (addr, 1),
base == reg ? NULL_RTX : reg);
if (GET_CODE (new_rtx) == CONST_INT)
- new_rtx = plus_constant (base, INTVAL (new_rtx));
+ new_rtx = plus_constant (Pmode, base, INTVAL (new_rtx));
else
{
if (GET_CODE (new_rtx) == PLUS && CONSTANT_P (XEXP (new_rtx, 1)))
@@ -3807,7 +3807,8 @@ legitimize_tls_address (rtx addr, rtx reg)
new_rtx = gen_rtx_CONST (Pmode, new_rtx);
new_rtx = legitimize_tls_address (new_rtx, reg);
- new_rtx = plus_constant (new_rtx, INTVAL (XEXP (XEXP (addr, 0), 1)));
+ new_rtx = plus_constant (Pmode, new_rtx,
+ INTVAL (XEXP (XEXP (addr, 0), 1)));
new_rtx = force_operand (new_rtx, 0);
}
@@ -4941,7 +4942,7 @@ s390_delegitimize_address (rtx orig_x)
if (GET_CODE (y) == UNSPEC
&& (XINT (y, 1) == UNSPEC_GOTOFF
|| XINT (y, 1) == UNSPEC_PLTOFF))
- return plus_constant (XVECEXP (y, 0, 0), offset);
+ return plus_constant (Pmode, XVECEXP (y, 0, 0), offset);
}
if (GET_CODE (x) != MEM)
@@ -5328,7 +5329,8 @@ print_operand (FILE *file, rtx x, int code)
if (GET_CODE (x) == REG)
x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1);
else if (GET_CODE (x) == MEM)
- x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4));
+ x = change_address (x, VOIDmode,
+ plus_constant (Pmode, XEXP (x, 0), 4));
else
output_operand_lossage ("register or memory expression expected "
"for 'N' output modifier");
@@ -5338,7 +5340,8 @@ print_operand (FILE *file, rtx x, int code)
if (GET_CODE (x) == REG)
x = gen_rtx_REG (GET_MODE (x), REGNO (x) + 1);
else if (GET_CODE (x) == MEM)
- x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8));
+ x = change_address (x, VOIDmode,
+ plus_constant (Pmode, XEXP (x, 0), 8));
else
output_operand_lossage ("register or memory expression expected "
"for 'M' output modifier");
@@ -5644,7 +5647,7 @@ annotate_constant_pool_refs (rtx *x)
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base),
UNSPEC_LTREF);
- *x = replace_equiv_address (*x, plus_constant (addr, off));
+ *x = replace_equiv_address (*x, plus_constant (Pmode, addr, off));
return;
}
}
@@ -5677,7 +5680,7 @@ annotate_constant_pool_refs (rtx *x)
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base),
UNSPEC_LTREF);
- SET_SRC (*x) = plus_constant (addr, off);
+ SET_SRC (*x) = plus_constant (Pmode, addr, off);
return;
}
}
@@ -5874,7 +5877,7 @@ replace_constant_pool_ref (rtx *x, rtx ref, rtx offset)
&& XVECEXP (XEXP (*x, 0), 0, 0) == ref)
{
rtx addr = gen_rtx_PLUS (Pmode, XVECEXP (XEXP (*x, 0), 0, 1), offset);
- *x = plus_constant (addr, INTVAL (XEXP (*x, 1)));
+ *x = plus_constant (Pmode, addr, INTVAL (XEXP (*x, 1)));
return;
}
@@ -7033,7 +7036,7 @@ s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED)
else
offset = RETURN_REGNUM * UNITS_PER_LONG;
- addr = plus_constant (frame, offset);
+ addr = plus_constant (Pmode, frame, offset);
addr = memory_address (Pmode, addr);
return gen_rtx_MEM (Pmode, addr);
}
@@ -7049,7 +7052,7 @@ s390_back_chain_rtx (void)
gcc_assert (TARGET_BACKCHAIN);
if (TARGET_PACKED_STACK)
- chain = plus_constant (stack_pointer_rtx,
+ chain = plus_constant (Pmode, stack_pointer_rtx,
STACK_POINTER_OFFSET - UNITS_PER_LONG);
else
chain = stack_pointer_rtx;
@@ -7711,7 +7714,7 @@ static rtx
save_fpr (rtx base, int offset, int regnum)
{
rtx addr;
- addr = gen_rtx_MEM (DFmode, plus_constant (base, offset));
+ addr = gen_rtx_MEM (DFmode, plus_constant (Pmode, base, offset));
if (regnum >= 16 && regnum <= (16 + FP_ARG_NUM_REG))
set_mem_alias_set (addr, get_varargs_alias_set ());
@@ -7728,7 +7731,7 @@ static rtx
restore_fpr (rtx base, int offset, int regnum)
{
rtx addr;
- addr = gen_rtx_MEM (DFmode, plus_constant (base, offset));
+ addr = gen_rtx_MEM (DFmode, plus_constant (Pmode, base, offset));
set_mem_alias_set (addr, get_frame_alias_set ());
return emit_move_insn (gen_rtx_REG (DFmode, regnum), addr);
@@ -7759,7 +7762,7 @@ save_gprs (rtx base, int offset, int first, int last)
rtx addr, insn, note;
int i;
- addr = plus_constant (base, offset);
+ addr = plus_constant (Pmode, base, offset);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, get_frame_alias_set ());
@@ -7826,7 +7829,8 @@ save_gprs (rtx base, int offset, int first, int last)
if (start > last)
return insn;
- addr = plus_constant (base, offset + (start - first) * UNITS_PER_LONG);
+ addr = plus_constant (Pmode, base,
+ offset + (start - first) * UNITS_PER_LONG);
note = gen_store_multiple (gen_rtx_MEM (Pmode, addr),
gen_rtx_REG (Pmode, start),
GEN_INT (last - start + 1));
@@ -7855,7 +7859,7 @@ restore_gprs (rtx base, int offset, int first, int last)
{
rtx addr, insn;
- addr = plus_constant (base, offset);
+ addr = plus_constant (Pmode, base, offset);
addr = gen_rtx_MEM (Pmode, addr);
set_mem_alias_set (addr, get_frame_alias_set ());
@@ -8158,7 +8162,7 @@ s390_emit_prologue (void)
{
if (cfun_frame_layout.backchain_offset)
addr = gen_rtx_MEM (Pmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
cfun_frame_layout.backchain_offset));
else
addr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
@@ -8193,7 +8197,7 @@ s390_emit_prologue (void)
for (i = 24; i <= next_fpr; i++)
if (cfun_fpr_bit_p (i - 16))
{
- rtx addr = plus_constant (stack_pointer_rtx,
+ rtx addr = plus_constant (Pmode, stack_pointer_rtx,
cfun_frame_layout.frame_size
+ cfun_frame_layout.f8_offset
+ offset);
@@ -8375,7 +8379,7 @@ s390_emit_epilogue (bool sibcall)
{
if (global_not_special_regno_p (i))
{
- addr = plus_constant (frame_pointer,
+ addr = plus_constant (Pmode, frame_pointer,
offset + cfun_frame_layout.gprs_offset
+ (i - cfun_frame_layout.first_save_gpr_slot)
* UNITS_PER_LONG);
@@ -8403,7 +8407,7 @@ s390_emit_epilogue (bool sibcall)
return_regnum = 4;
return_reg = gen_rtx_REG (Pmode, return_regnum);
- addr = plus_constant (frame_pointer,
+ addr = plus_constant (Pmode, frame_pointer,
offset + cfun_frame_layout.gprs_offset
+ (RETURN_REGNUM
- cfun_frame_layout.first_save_gpr_slot)
@@ -8424,7 +8428,8 @@ s390_emit_epilogue (bool sibcall)
insn = emit_insn (insn);
REG_NOTES (insn) = cfa_restores;
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (stack_pointer_rtx, STACK_POINTER_OFFSET));
+ plus_constant (Pmode, stack_pointer_rtx,
+ STACK_POINTER_OFFSET));
RTX_FRAME_RELATED_P (insn) = 1;
}
@@ -9285,7 +9290,7 @@ s390_function_profiler (FILE *file, int labelno)
op[0] = gen_rtx_REG (Pmode, RETURN_REGNUM);
op[1] = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
- op[1] = gen_rtx_MEM (Pmode, plus_constant (op[1], UNITS_PER_LONG));
+ op[1] = gen_rtx_MEM (Pmode, plus_constant (Pmode, op[1], UNITS_PER_LONG));
op[2] = gen_rtx_REG (Pmode, 1);
op[3] = gen_rtx_SYMBOL_REF (Pmode, label);
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index edc6399789e..99c09e8860e 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -539,7 +539,7 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
/* Defining this macro makes __builtin_frame_address(0) and
__builtin_return_address(0) work with -fomit-frame-pointer. */
#define INITIAL_FRAME_ADDRESS_RTX \
- (plus_constant (arg_pointer_rtx, -STACK_POINTER_OFFSET))
+ (plus_constant (Pmode, arg_pointer_rtx, -STACK_POINTER_OFFSET))
/* The return address of the current frame is retrieved
from the initial value of register RETURN_REGNUM.
@@ -547,7 +547,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
the corresponding RETURN_REGNUM register was saved. */
#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
(TARGET_PACKED_STACK ? \
- plus_constant ((FRAME), STACK_POINTER_OFFSET - UNITS_PER_LONG) : (FRAME))
+ plus_constant (Pmode, (FRAME), \
+ STACK_POINTER_OFFSET - UNITS_PER_LONG) : (FRAME))
/* For -mpacked-stack this adds 160 - 8 (96 - 4) to the output of
builtin_frame_address. Otherwise arg pointer -
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index ef1ab269bae..a467d4a10ec 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -2353,7 +2353,8 @@
XVECEXP (operands[3], 0, i)
= gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
change_address (operands[1], mode,
- plus_constant (from, off + i * GET_MODE_SIZE (mode))));
+ plus_constant (Pmode, from,
+ off + i * GET_MODE_SIZE (mode))));
})
(define_insn "*load_multiple_di"
@@ -2443,7 +2444,8 @@
XVECEXP (operands[3], 0, i)
= gen_rtx_SET (VOIDmode,
change_address (operands[0], mode,
- plus_constant (to, off + i * GET_MODE_SIZE (mode))),
+ plus_constant (Pmode, to,
+ off + i * GET_MODE_SIZE (mode))),
gen_rtx_REG (mode, regno + i));
})
diff --git a/gcc/config/score/score.c b/gcc/config/score/score.c
index 28a0265978b..0af0fd50b82 100644
--- a/gcc/config/score/score.c
+++ b/gcc/config/score/score.c
@@ -444,7 +444,7 @@ score_add_offset (rtx reg, HOST_WIDE_INT offset)
offset &= 0x3fff;
}
- return plus_constant (reg, offset);
+ return plus_constant (GET_MODE (reg), reg, offset);
}
/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text
@@ -1546,8 +1546,8 @@ score_prologue (void)
REG_NOTES (insn) =
alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -size)),
+ plus_constant (Pmode, stack_pointer_rtx,
+ -size)),
REG_NOTES (insn));
}
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 7dbbe1c5728..d86347499a6 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -1499,7 +1499,7 @@ expand_block_move (rtx *operands)
set_mem_size (from, 4);
emit_insn (gen_movua (temp, from));
- emit_move_insn (src_addr, plus_constant (src_addr, 4));
+ emit_move_insn (src_addr, plus_constant (Pmode, src_addr, 4));
emit_move_insn (to, temp);
copied += 4;
}
@@ -6584,12 +6584,13 @@ push_regs (HARD_REG_SET *mask, int interrupt_handler)
x = frame_insn (x);
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
{
- mem = gen_rtx_MEM (SImode, plus_constant (sp_reg, i * 4));
+ mem = gen_rtx_MEM (SImode, plus_constant (Pmode, sp_reg, i * 4));
reg = gen_rtx_REG (SImode, i);
add_reg_note (x, REG_CFA_OFFSET, gen_rtx_SET (SImode, mem, reg));
}
- set = gen_rtx_SET (SImode, sp_reg, plus_constant (sp_reg, - 32));
+ set = gen_rtx_SET (SImode, sp_reg,
+ plus_constant (Pmode, sp_reg, - 32));
add_reg_note (x, REG_CFA_ADJUST_CFA, set);
emit_insn (gen_blockage ());
}
@@ -7817,7 +7818,8 @@ sh_builtin_saveregs (void)
rtx addr, mask;
regbuf = assign_stack_local (BLKmode, bufsize + UNITS_PER_WORD, 0);
- addr = copy_to_mode_reg (Pmode, plus_constant (XEXP (regbuf, 0), 4));
+ addr = copy_to_mode_reg (Pmode, plus_constant (Pmode,
+ XEXP (regbuf, 0), 4));
mask = copy_to_mode_reg (Pmode, GEN_INT (-8));
emit_insn (gen_andsi3 (addr, addr, mask));
regbuf = change_address (regbuf, BLKmode, addr);
@@ -7849,8 +7851,8 @@ sh_builtin_saveregs (void)
We emit the moves in reverse order so that we can use predecrement. */
fpregs = copy_to_mode_reg (Pmode,
- plus_constant (XEXP (regbuf, 0),
- n_floatregs * UNITS_PER_WORD));
+ plus_constant (Pmode, XEXP (regbuf, 0),
+ n_floatregs * UNITS_PER_WORD));
if (TARGET_SH4 || TARGET_SH2A_DOUBLE)
{
rtx mem;
@@ -11777,7 +11779,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
error ("need a call-clobbered target register");
}
- this_value = plus_constant (this_rtx, delta);
+ this_value = plus_constant (Pmode, this_rtx, delta);
if (vcall_offset
&& (simple_add || scratch0 != scratch1)
&& strict_memory_address_p (ptr_mode, this_value))
@@ -11803,7 +11805,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (!did_load)
emit_load_ptr (scratch0, this_rtx);
- offset_addr = plus_constant (scratch0, vcall_offset);
+ offset_addr = plus_constant (Pmode, scratch0, vcall_offset);
if (strict_memory_address_p (ptr_mode, offset_addr))
; /* Do nothing. */
else if (! TARGET_SH5 && scratch0 != scratch1)
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 45a5edf6ad7..914d5bf8b92 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -6187,7 +6187,7 @@ label:
if (TARGET_SH5 && true_regnum (operands[1]) < 16)
{
emit_move_insn (stack_pointer_rtx,
- plus_constant (stack_pointer_rtx, -8));
+ plus_constant (Pmode, stack_pointer_rtx, -8));
tos = gen_tmp_stack_mem (DFmode, stack_pointer_rtx);
}
else
@@ -6203,7 +6203,8 @@ label:
gen_rtx_POST_INC (Pmode, stack_pointer_rtx));
insn = emit_insn (gen_movdf_i4 (operands[0], tos, operands[2]));
if (TARGET_SH5 && true_regnum (operands[0]) < 16)
- emit_move_insn (stack_pointer_rtx, plus_constant (stack_pointer_rtx, 8));
+ emit_move_insn (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx, 8));
else
add_reg_note (insn, REG_INC, stack_pointer_rtx);
DONE;
@@ -6413,7 +6414,7 @@ label:
case PLUS:
emit_insn (gen_movsf_ie (reg0, operands[1], operands[2]));
operands[1] = copy_rtx (operands[1]);
- XEXP (operands[1], 0) = plus_constant (addr, 4);
+ XEXP (operands[1], 0) = plus_constant (Pmode, addr, 4);
emit_insn (gen_movsf_ie (reg1, operands[1], operands[2]));
break;
@@ -6480,7 +6481,7 @@ label:
emit_insn (gen_movsf_ie (operands[0], reg0, operands[2]));
operands[0] = copy_rtx (operands[0]);
- XEXP (operands[0], 0) = plus_constant (addr, 4);
+ XEXP (operands[0], 0) = plus_constant (Pmode, addr, 4);
emit_insn (gen_movsf_ie (operands[0], reg1, operands[2]));
break;
@@ -11244,7 +11245,8 @@ label:
emit_insn (gen_movsi (shift_reg, operands[3]));
qi_val = gen_rtx_SUBREG (QImode, shift_reg, 3);
}
- addr_target = copy_addr_to_reg (plus_constant (orig_address, size - 1));
+ addr_target = copy_addr_to_reg (plus_constant (Pmode,
+ orig_address, size - 1));
operands[0] = replace_equiv_address (operands[0], addr_target);
emit_insn (gen_movqi (operands[0], qi_val));
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 0db171854b4..4cb381e60e9 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -3866,7 +3866,7 @@ sparc_legitimize_pic_address (rtx orig, rtx reg)
if (GET_CODE (offset) == CONST_INT)
{
if (SMALL_INT (offset))
- return plus_constant (base, INTVAL (offset));
+ return plus_constant (Pmode, base, INTVAL (offset));
else if (can_create_pseudo_p ())
offset = force_reg (Pmode, offset);
else
@@ -4605,7 +4605,7 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
emit_move_insn (g1, GEN_INT (first));
emit_insn (gen_rtx_SET (VOIDmode, g1,
gen_rtx_MINUS (Pmode, stack_pointer_rtx, g1)));
- emit_stack_probe (plus_constant (g1, -size));
+ emit_stack_probe (plus_constant (Pmode, g1, -size));
}
/* The run-time loop is made up of 10 insns in the generic case while the
@@ -4625,11 +4625,12 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
for (i = 2 * PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
{
emit_insn (gen_rtx_SET (VOIDmode, g1,
- plus_constant (g1, -PROBE_INTERVAL)));
+ plus_constant (Pmode, g1, -PROBE_INTERVAL)));
emit_stack_probe (g1);
}
- emit_stack_probe (plus_constant (g1, (i - PROBE_INTERVAL) - size));
+ emit_stack_probe (plus_constant (Pmode, g1,
+ (i - PROBE_INTERVAL) - size));
}
/* Otherwise, do the same as above, but in a loop. Note that we must be
@@ -4682,7 +4683,7 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
that SIZE is equal to ROUNDED_SIZE. */
if (size != rounded_size)
- emit_stack_probe (plus_constant (g4, rounded_size - size));
+ emit_stack_probe (plus_constant (Pmode, g4, rounded_size - size));
}
/* Make sure nothing is scheduled before we are done. */
@@ -4759,7 +4760,8 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
{
if (save_p (i, leaf_function))
{
- mem = gen_frame_mem (DImode, plus_constant (base, offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode,
+ base, offset));
if (action_true == SORR_SAVE)
{
insn = emit_move_insn (mem, gen_rtx_REG (DImode, i));
@@ -4784,7 +4786,7 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
if (fp_offset >= 0)
{
- mem = gen_frame_mem (DImode, plus_constant (base, fp_offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode, base, fp_offset));
emit_move_insn (hard_frame_pointer_rtx, mem);
}
}
@@ -4820,7 +4822,7 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
continue;
}
- mem = gen_frame_mem (mode, plus_constant (base, offset));
+ mem = gen_frame_mem (mode, plus_constant (Pmode, base, offset));
if (action_true == SORR_SAVE)
{
insn = emit_move_insn (mem, gen_rtx_REG (mode, regno));
@@ -4828,12 +4830,14 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
if (mode == DImode)
{
rtx set1, set2;
- mem = gen_frame_mem (SImode, plus_constant (base, offset));
+ mem = gen_frame_mem (SImode, plus_constant (Pmode, base,
+ offset));
set1 = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (SImode, regno));
RTX_FRAME_RELATED_P (set1) = 1;
mem
- = gen_frame_mem (SImode, plus_constant (base, offset + 4));
+ = gen_frame_mem (SImode, plus_constant (Pmode, base,
+ offset + 4));
set2 = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (SImode, regno + 1));
RTX_FRAME_RELATED_P (set2) = 1;
@@ -4923,7 +4927,7 @@ emit_window_save (rtx increment)
/* The CFA is %fp, the hard frame pointer. */
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (hard_frame_pointer_rtx,
+ plus_constant (Pmode, hard_frame_pointer_rtx,
INCOMING_FRAME_SP_OFFSET));
return insn;
@@ -5145,7 +5149,7 @@ sparc_flat_expand_prologue (void)
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
size)));
}
@@ -6736,10 +6740,10 @@ sparc_struct_value_rtx (tree fndecl, int incoming)
rtx mem;
if (incoming)
- mem = gen_frame_mem (Pmode, plus_constant (frame_pointer_rtx,
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, frame_pointer_rtx,
STRUCT_VALUE_OFFSET));
else
- mem = gen_frame_mem (Pmode, plus_constant (stack_pointer_rtx,
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, stack_pointer_rtx,
STRUCT_VALUE_OFFSET));
/* Only follow the SPARC ABI for fixed-size structure returns.
@@ -6770,7 +6774,8 @@ sparc_struct_value_rtx (tree fndecl, int incoming)
it's an unimp instruction (the most significant 10 bits
will be zero). */
emit_move_insn (scratch, gen_rtx_MEM (SImode,
- plus_constant (ret_reg, 8)));
+ plus_constant (Pmode,
+ ret_reg, 8)));
/* Assume the size is valid and pre-adjust */
emit_insn (gen_add3_insn (ret_reg, ret_reg, GEN_INT (4)));
emit_cmp_and_jump_insns (scratch, size_rtx, EQ, const0_rtx, SImode,
@@ -10420,7 +10425,7 @@ emit_and_preserve (rtx seq, rtx reg, rtx reg2)
HOST_WIDE_INT size = SPARC_STACK_ALIGN (offset + 2*UNITS_PER_WORD);
rtx slot
- = gen_rtx_MEM (word_mode, plus_constant (stack_pointer_rtx,
+ = gen_rtx_MEM (word_mode, plus_constant (Pmode, stack_pointer_rtx,
SPARC_STACK_BIAS + offset));
emit_insn (gen_stack_pointer_dec (GEN_INT (size)));
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index a1919b4e7e7..a2bf09f1c81 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1273,11 +1273,11 @@ do { \
return an rtx for the address of the word in the frame
that holds the dynamic chain--the previous frame's address. */
#define DYNAMIC_CHAIN_ADDRESS(frame) \
- plus_constant (frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
+ plus_constant (Pmode, frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
/* Given an rtx for the frame pointer,
return an rtx for the address of the frame. */
-#define FRAME_ADDR_RTX(frame) plus_constant (frame, SPARC_STACK_BIAS)
+#define FRAME_ADDR_RTX(frame) plus_constant (Pmode, frame, SPARC_STACK_BIAS)
/* The return address isn't on the stack, it is in a register, so we can't
access it from the current frame pointer. We can access it from the
@@ -1299,7 +1299,7 @@ do { \
((count == -1) \
? gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM) \
: gen_rtx_MEM (Pmode, \
- memory_address (Pmode, plus_constant (frame, \
+ memory_address (Pmode, plus_constant (Pmode, frame, \
15 * UNITS_PER_WORD \
+ SPARC_STACK_BIAS))))
@@ -1309,7 +1309,8 @@ do { \
is something you can return to. */
#define INCOMING_RETURN_ADDR_REGNUM 15
#define INCOMING_RETURN_ADDR_RTX \
- plus_constant (gen_rtx_REG (word_mode, INCOMING_RETURN_ADDR_REGNUM), 8)
+ plus_constant (word_mode, \
+ gen_rtx_REG (word_mode, INCOMING_RETURN_ADDR_REGNUM), 8)
#define DWARF_FRAME_RETURN_COLUMN \
DWARF_FRAME_REGNUM (INCOMING_RETURN_ADDR_REGNUM)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 4c7a2b0b232..aafff5598d1 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6436,7 +6436,7 @@
instruction (the most significant 10 bits will be zero). If so,
update the return address to skip the unimp instruction. */
emit_move_insn (value,
- gen_rtx_MEM (SImode, plus_constant (rtnreg, 8)));
+ gen_rtx_MEM (SImode, plus_constant (SImode, rtnreg, 8)));
emit_insn (gen_lshrsi3 (value, value, GEN_INT (22)));
emit_insn (gen_update_return (rtnreg, value));
}
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index c65d003c40e..dc5ca45dd57 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -858,7 +858,7 @@ spu_expand_insv (rtx ops[])
rtx mask1 = gen_reg_rtx (TImode);
rtx dst1 = gen_reg_rtx (TImode);
rtx mem1;
- addr1 = plus_constant (addr, 16);
+ addr1 = plus_constant (Pmode, addr, 16);
addr1 = gen_rtx_AND (Pmode, addr1, GEN_INT (-16));
emit_insn (gen_subsi3 (shl, GEN_INT (16), low));
emit_insn (gen_shlqby_ti (mask1, mask, shl));
@@ -2949,7 +2949,7 @@ spu_machine_dependent_reorg (void)
if (NONJUMP_INSN_P (branch))
offset += get_attr_length (branch);
if (offset > 0)
- XVECEXP (unspec, 0, 0) = plus_constant (label_ref, offset);
+ XVECEXP (unspec, 0, 0) = plus_constant (Pmode, label_ref, offset);
}
spu_var_tracking ();
@@ -4379,7 +4379,7 @@ spu_setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
for (regno = ncum; regno < MAX_REGISTER_ARGS; regno++)
{
tmp = gen_frame_mem (V4SImode,
- plus_constant (virtual_incoming_args_rtx,
+ plus_constant (Pmode, virtual_incoming_args_rtx,
offset));
emit_move_insn (tmp,
gen_rtx_REG (V4SImode, FIRST_ARG_REGNUM + regno));
@@ -4556,7 +4556,7 @@ ea_load_store_inline (rtx mem, bool is_store, rtx ea_addr, rtx data_addr)
tag_equal_hi = gen_reg_rtx (V4SImode);
}
- emit_move_insn (index_mask, plus_constant (tag_size_sym, -128));
+ emit_move_insn (index_mask, plus_constant (Pmode, tag_size_sym, -128));
emit_move_insn (tag_arr, tag_arr_sym);
v = 0x0001020300010203LL;
emit_move_insn (splat_mask, immed_double_const (v, v, TImode));
@@ -4583,14 +4583,16 @@ ea_load_store_inline (rtx mem, bool is_store, rtx ea_addr, rtx data_addr)
emit_move_insn (cache_tag, gen_rtx_MEM (V4SImode, tag_addr));
if (spu_ea_model != 32)
emit_move_insn (cache_tag_hi, gen_rtx_MEM (V4SImode,
- plus_constant (tag_addr, 16)));
+ plus_constant (Pmode,
+ tag_addr, 16)));
/* tag = ea_addr & -128 */
emit_insn (gen_andv4si3 (tag, splat, spu_const (V4SImode, -128)));
/* Read all four cache data pointers. */
emit_move_insn (cache_ptrs, gen_rtx_MEM (TImode,
- plus_constant (tag_addr, 32)));
+ plus_constant (Pmode,
+ tag_addr, 32)));
/* Compare tags. */
emit_insn (gen_ceq_v4si (tag_equal, tag, cache_tag));
@@ -4941,7 +4943,7 @@ spu_expand_load (rtx dst0, rtx dst1, rtx src, int extra_rotby)
if (dst1)
{
- addr1 = plus_constant (copy_rtx (addr), 16);
+ addr1 = plus_constant (SImode, copy_rtx (addr), 16);
addr1 = gen_rtx_AND (SImode, addr1, GEN_INT (-16));
emit_insn (gen__movti (dst1, change_address (src, TImode, addr1)));
}
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index d89bf49f2d2..ce0bc8edb5f 100644
--- a/gcc/config/spu/spu.h
+++ b/gcc/config/spu/spu.h
@@ -250,7 +250,7 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define FIRST_PARM_OFFSET(FNDECL) (0)
-#define DYNAMIC_CHAIN_ADDRESS(FP) plus_constant ((FP), -16)
+#define DYNAMIC_CHAIN_ADDRESS(FP) plus_constant (Pmode, (FP), -16)
#define RETURN_ADDR_RTX(COUNT,FP) (spu_return_addr (COUNT, FP))
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 99acee6f69b..a2e6481d07b 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1053,7 +1053,8 @@ xstormy16_expand_prologue (void)
gen_rtx_MEM (Pmode, stack_pointer_rtx),
reg);
XVECEXP (dwarf, 0, 1) = gen_rtx_SET (Pmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
GET_MODE_SIZE (Pmode)));
add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
RTX_FRAME_RELATED_P (XVECEXP (dwarf, 0, 0)) = 1;
@@ -1076,7 +1077,8 @@ xstormy16_expand_prologue (void)
gen_rtx_MEM (Pmode, stack_pointer_rtx),
reg);
XVECEXP (dwarf, 0, 1) = gen_rtx_SET (Pmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, \
+ stack_pointer_rtx,
GET_MODE_SIZE (Pmode)));
add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
RTX_FRAME_RELATED_P (XVECEXP (dwarf, 0, 0)) = 1;
@@ -2564,7 +2566,7 @@ combine_bnp (rtx insn)
if (! (mask & 0xff))
{
- addr = plus_constant (addr, 1);
+ addr = plus_constant (Pmode, addr, 1);
mask >>= 8;
}
mem = gen_rtx_MEM (QImode, addr);
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 217682eaa66..a23e193ee3a 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -352,7 +352,8 @@ tilegx_setup_incoming_varargs (cumulative_args_t cum,
{
alias_set_type set = get_varargs_alias_set ();
rtx tmp =
- gen_rtx_MEM (BLKmode, plus_constant (virtual_incoming_args_rtx,
+ gen_rtx_MEM (BLKmode, plus_constant (Pmode,
+ virtual_incoming_args_rtx,
-STACK_POINTER_OFFSET -
UNITS_PER_WORD *
(TILEGX_NUM_ARG_REGS -
@@ -1755,7 +1756,7 @@ tilegx_expand_unaligned_load (rtx dest_reg, rtx mem, HOST_WIDE_INT bitsize,
implicitly alias surrounding code. Ideally we'd have some alias
set that covered all types except those with alignment 8 or
higher. */
- addr_lo = force_reg (Pmode, plus_constant (mema, byte_offset));
+ addr_lo = force_reg (Pmode, plus_constant (Pmode, mema, byte_offset));
mem_lo = change_address (mem, mode,
gen_rtx_AND (GET_MODE (mema), addr_lo,
GEN_INT (-8)));
@@ -1764,7 +1765,7 @@ tilegx_expand_unaligned_load (rtx dest_reg, rtx mem, HOST_WIDE_INT bitsize,
/* Load the high word at an address that will not fault if the low
address is aligned and at the very end of a page. */
last_byte_offset = (bit_offset + bitsize - 1) / BITS_PER_UNIT;
- addr_hi = force_reg (Pmode, plus_constant (mema, last_byte_offset));
+ addr_hi = force_reg (Pmode, plus_constant (Pmode, mema, last_byte_offset));
mem_hi = change_address (mem, mode,
gen_rtx_AND (GET_MODE (mema), addr_hi,
GEN_INT (-8)));
@@ -4890,7 +4891,7 @@ tilegx_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
/* Get pointers to the beginning and end of the code block. */
begin_addr = force_reg (Pmode, XEXP (m_tramp, 0));
- end_addr = force_reg (Pmode, plus_constant (XEXP (m_tramp, 0),
+ end_addr = force_reg (Pmode, plus_constant (Pmode, XEXP (m_tramp, 0),
TRAMPOLINE_SIZE));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
diff --git a/gcc/config/tilegx/tilegx.h b/gcc/config/tilegx/tilegx.h
index 081ecc1756a..ac69061d85c 100644
--- a/gcc/config/tilegx/tilegx.h
+++ b/gcc/config/tilegx/tilegx.h
@@ -243,7 +243,8 @@ enum reg_class
#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET 0
-#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant ((FRAME), UNITS_PER_WORD)
+#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
+ plus_constant (Pmode, (FRAME), UNITS_PER_WORD)
#define FIRST_PARM_OFFSET(FNDECL) 0
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index 011ac083add..2b18b4f6622 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -356,7 +356,8 @@ tilepro_setup_incoming_varargs (cumulative_args_t cum,
{
alias_set_type set = get_varargs_alias_set ();
rtx tmp =
- gen_rtx_MEM (BLKmode, plus_constant (virtual_incoming_args_rtx,
+ gen_rtx_MEM (BLKmode, plus_constant (Pmode, \
+ virtual_incoming_args_rtx,
-STACK_POINTER_OFFSET -
UNITS_PER_WORD *
(TILEPRO_NUM_ARG_REGS -
@@ -1640,7 +1641,7 @@ tilepro_expand_unaligned_load (rtx dest_reg, rtx mem, HOST_WIDE_INT bitsize,
implicitly alias surrounding code. Ideally we'd have some alias
set that covered all types except those with alignment 8 or
higher. */
- addr_lo = force_reg (Pmode, plus_constant (mema, byte_offset));
+ addr_lo = force_reg (Pmode, plus_constant (Pmode, mema, byte_offset));
mem_lo = change_address (mem, mode,
gen_rtx_AND (Pmode, addr_lo, GEN_INT (-4)));
set_mem_alias_set (mem_lo, 0);
@@ -1648,7 +1649,7 @@ tilepro_expand_unaligned_load (rtx dest_reg, rtx mem, HOST_WIDE_INT bitsize,
/* Load the high word at an address that will not fault if the low
address is aligned and at the very end of a page. */
last_byte_offset = (bit_offset + bitsize - 1) / BITS_PER_UNIT;
- addr_hi = force_reg (Pmode, plus_constant (mema, last_byte_offset));
+ addr_hi = force_reg (Pmode, plus_constant (Pmode, mema, last_byte_offset));
mem_hi = change_address (mem, mode,
gen_rtx_AND (Pmode, addr_hi, GEN_INT (-4)));
set_mem_alias_set (mem_hi, 0);
@@ -4455,7 +4456,7 @@ tilepro_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
/* Get pointers to the beginning and end of the code block. */
begin_addr = force_reg (Pmode, XEXP (m_tramp, 0));
- end_addr = force_reg (Pmode, plus_constant (XEXP (m_tramp, 0),
+ end_addr = force_reg (Pmode, plus_constant (Pmode, XEXP (m_tramp, 0),
TRAMPOLINE_SIZE));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
diff --git a/gcc/config/tilepro/tilepro.h b/gcc/config/tilepro/tilepro.h
index 930612d1fb4..593bf68d60a 100644
--- a/gcc/config/tilepro/tilepro.h
+++ b/gcc/config/tilepro/tilepro.h
@@ -226,7 +226,8 @@ enum reg_class
#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET 0
-#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant ((FRAME), UNITS_PER_WORD)
+#define DYNAMIC_CHAIN_ADDRESS(FRAME) \
+ plus_constant (Pmode, (FRAME), UNITS_PER_WORD)
#define FIRST_PARM_OFFSET(FNDECL) 0
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 5c43607347e..e2a72b0b3d5 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -1719,7 +1719,8 @@ expand_prologue (void)
if (num_save > 0 && REGNO (save_regs[num_save-1]) == LINK_POINTER_REGNUM)
{
emit_move_insn (gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
save_regs[--num_save]);
offset -= 4;
@@ -1728,7 +1729,8 @@ expand_prologue (void)
for (i = 0; i < num_save; i++)
{
emit_move_insn (gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)),
save_regs[i]);
offset -= 4;
@@ -1916,7 +1918,8 @@ expand_epilogue (void)
{
emit_move_insn (restore_regs[--num_restore],
gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)));
offset -= 4;
}
@@ -1925,7 +1928,8 @@ expand_epilogue (void)
{
emit_move_insn (restore_regs[i],
gen_rtx_MEM (SImode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode,
+ stack_pointer_rtx,
offset)));
emit_use (restore_regs[i]);
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index bf3492e7975..4ac565383cd 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -648,7 +648,8 @@
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0), log2 / 8));
+ plus_constant (Pmode, XEXP (operands[0], 0),
+ log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("clr1 %1,%0", xoperands);
return "";
@@ -668,7 +669,8 @@
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0), log2 / 8));
+ plus_constant (Pmode, XEXP (operands[0], 0),
+ log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("clr1 %1,%0", xoperands);
return "";
@@ -719,7 +721,7 @@
{
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0),
+ plus_constant (Pmode, XEXP (operands[0], 0),
log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("set1 %1,%0", xoperands);
@@ -745,7 +747,7 @@
{
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0),
+ plus_constant (Pmode, XEXP (operands[0], 0),
log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("set1 %1,%0", xoperands);
@@ -798,7 +800,7 @@
{
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0),
+ plus_constant (Pmode, XEXP (operands[0], 0),
log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("not1 %1,%0", xoperands);
@@ -824,7 +826,7 @@
{
rtx xoperands[2];
xoperands[0] = gen_rtx_MEM (QImode,
- plus_constant (XEXP (operands[0], 0),
+ plus_constant (Pmode, XEXP (operands[0], 0),
log2 / 8));
xoperands[1] = GEN_INT (log2 % 8);
output_asm_insn ("not1 %1,%0", xoperands);
diff --git a/gcc/config/vax/elf.h b/gcc/config/vax/elf.h
index 8e5f4afe650..7796f348d59 100644
--- a/gcc/config/vax/elf.h
+++ b/gcc/config/vax/elf.h
@@ -55,13 +55,15 @@ along with GCC; see the file COPYING3. If not see
/* Place the top of the stack for the DWARF2 EH stackadj value. */
#define EH_RETURN_STACKADJ_RTX \
gen_rtx_MEM (SImode, \
- plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
+ plus_constant (Pmode, \
+ gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
-4))
/* Simple store the return handler into the call frame. */
#define EH_RETURN_HANDLER_RTX \
gen_rtx_MEM (Pmode, \
- plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
+ plus_constant (Pmode, \
+ gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
16))
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index 4e704b6f714..aa929ca1e50 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -138,7 +138,7 @@ vax_add_reg_cfa_offset (rtx insn, int offset, rtx src)
{
rtx x;
- x = plus_constant (frame_pointer_rtx, offset);
+ x = plus_constant (Pmode, frame_pointer_rtx, offset);
x = gen_rtx_MEM (SImode, x);
x = gen_rtx_SET (VOIDmode, x, src);
add_reg_note (insn, REG_CFA_OFFSET, x);
@@ -201,7 +201,7 @@ vax_expand_prologue (void)
it will be processed first. This is required to allow the other
notes be interpreted properly. */
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (frame_pointer_rtx, offset));
+ plus_constant (Pmode, frame_pointer_rtx, offset));
/* Allocate the local stack frame. */
size = get_frame_size ();
@@ -373,11 +373,13 @@ print_operand_address (FILE * file, rtx addr)
if (offset)
{
if (CONST_INT_P (offset))
- offset = plus_constant (XEXP (addr, 0), INTVAL (offset));
+ offset = plus_constant (Pmode, XEXP (addr, 0),
+ INTVAL (offset));
else
{
gcc_assert (CONST_INT_P (XEXP (addr, 0)));
- offset = plus_constant (offset, INTVAL (XEXP (addr, 0)));
+ offset = plus_constant (Pmode, offset,
+ INTVAL (XEXP (addr, 0)));
}
}
offset = XEXP (addr, 0);
@@ -402,11 +404,13 @@ print_operand_address (FILE * file, rtx addr)
if (offset)
{
if (CONST_INT_P (offset))
- offset = plus_constant (XEXP (addr, 1), INTVAL (offset));
+ offset = plus_constant (Pmode, XEXP (addr, 1),
+ INTVAL (offset));
else
{
gcc_assert (CONST_INT_P (XEXP (addr, 1)));
- offset = plus_constant (offset, INTVAL (XEXP (addr, 1)));
+ offset = plus_constant (Pmode, offset,
+ INTVAL (XEXP (addr, 1)));
}
}
offset = XEXP (addr, 1);
@@ -2108,7 +2112,7 @@ vax_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
mem = adjust_address (m_tramp, SImode, 4);
emit_move_insn (mem, cxt);
mem = adjust_address (m_tramp, SImode, 11);
- emit_move_insn (mem, plus_constant (fnaddr, 2));
+ emit_move_insn (mem, plus_constant (Pmode, fnaddr, 2));
emit_insn (gen_sync_istream ());
}
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 0c835637ae1..a9de79c62fb 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -259,7 +259,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Given an rtx for the address of a frame,
return an rtx for the address of the word in the frame
that holds the dynamic chain--the previous frame's address. */
-#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant ((FRAME), 12)
+#define DYNAMIC_CHAIN_ADDRESS(FRAME) plus_constant (Pmode, (FRAME), 12)
/* If we generate an insn to push BYTES bytes,
this says how many the stack pointer really advances by.
@@ -370,7 +370,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT == 0) \
- ? gen_rtx_MEM (Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \
+ ? gen_rtx_MEM (Pmode, plus_constant (Pmode, FRAME, \
+ RETURN_ADDRESS_OFFSET)) \
: (rtx) 0)
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 7f42e48dd53..fa38008bb0b 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2682,7 +2682,8 @@ xtensa_expand_prologue (void)
note_rtx = gen_rtx_SET (VOIDmode, (frame_pointer_needed
? hard_frame_pointer_rtx
: stack_pointer_rtx),
- plus_constant (stack_pointer_rtx, -total_size));
+ plus_constant (Pmode, stack_pointer_rtx,
+ -total_size));
RTX_FRAME_RELATED_P (insn) = 1;
add_reg_note (insn, REG_FRAME_RELATED_EXPR, note_rtx);
}
@@ -2707,7 +2708,7 @@ xtensa_return_addr (int count, rtx frame)
retaddr = gen_rtx_REG (Pmode, A0_REG);
else
{
- rtx addr = plus_constant (frame, -4 * UNITS_PER_WORD);
+ rtx addr = plus_constant (Pmode, frame, -4 * UNITS_PER_WORD);
addr = memory_address (Pmode, addr);
retaddr = gen_reg_rtx (Pmode);
emit_move_insn (retaddr, gen_rtx_MEM (Pmode, addr));
@@ -3608,7 +3609,8 @@ static rtx
xtensa_static_chain (const_tree ARG_UNUSED (fndecl), bool incoming_p)
{
rtx base = incoming_p ? arg_pointer_rtx : stack_pointer_rtx;
- return gen_frame_mem (Pmode, plus_constant (base, -5 * UNITS_PER_WORD));
+ return gen_frame_mem (Pmode, plus_constant (Pmode, base,
+ -5 * UNITS_PER_WORD));
}