aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog247
-rw-r--r--gcc/alias.c7
-rw-r--r--gcc/builtins.c26
-rw-r--r--gcc/calls.c39
-rw-r--r--gcc/cfgexpand.c11
-rw-r--r--gcc/combine-stack-adj.c3
-rw-r--r--gcc/combine.c6
-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
-rw-r--r--gcc/cse.c8
-rw-r--r--gcc/cselib.c3
-rw-r--r--gcc/dse.c11
-rw-r--r--gcc/dwarf2out.c25
-rw-r--r--gcc/emit-rtl.c5
-rw-r--r--gcc/except.c8
-rw-r--r--gcc/explow.c56
-rw-r--r--gcc/expmed.c2
-rw-r--r--gcc/expr.c46
-rw-r--r--gcc/function.c8
-rw-r--r--gcc/optabs.c7
-rw-r--r--gcc/recog.c7
-rw-r--r--gcc/reload.c10
-rw-r--r--gcc/reload1.c16
-rw-r--r--gcc/rtl.h3
-rw-r--r--gcc/simplify-rtx.c16
-rw-r--r--gcc/var-tracking.c8
95 files changed, 1109 insertions, 663 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd2e135..364d2d7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,250 @@
+2012-05-05 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * 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.
+
2012-05-04 Andrew Pinski <apinski@cavium.com>
* expr.c (get_def_for_expr_class): New function.
diff --git a/gcc/alias.c b/gcc/alias.c
index 8366f9c..00af340 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1433,9 +1433,9 @@ canon_rtx (rtx x)
if (x0 != XEXP (x, 0) || x1 != XEXP (x, 1))
{
if (CONST_INT_P (x0))
- return plus_constant (x1, INTVAL (x0));
+ return plus_constant (GET_MODE (x), x1, INTVAL (x0));
else if (CONST_INT_P (x1))
- return plus_constant (x0, INTVAL (x1));
+ return plus_constant (GET_MODE (x), x0, INTVAL (x1));
return gen_rtx_PLUS (GET_MODE (x), x0, x1);
}
}
@@ -2928,7 +2928,8 @@ init_alias_analysis (void)
&& (t = get_reg_known_value (REGNO (XEXP (src, 0))))
&& CONST_INT_P (XEXP (src, 1)))
{
- t = plus_constant (t, INTVAL (XEXP (src, 1)));
+ t = plus_constant (GET_MODE (src), t,
+ INTVAL (XEXP (src, 1)));
set_reg_known_value (regno, t);
set_reg_known_equiv_p (regno, 0);
}
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1ce9ac1..8b20e43 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -844,7 +844,7 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
tem = RETURN_ADDR_RTX (count, tem);
#else
tem = memory_address (Pmode,
- plus_constant (tem, GET_MODE_SIZE (Pmode)));
+ plus_constant (Pmode, tem, GET_MODE_SIZE (Pmode)));
tem = gen_frame_mem (Pmode, tem);
#endif
return tem;
@@ -879,14 +879,15 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label)
set_mem_alias_set (mem, setjmp_alias_set);
emit_move_insn (mem, targetm.builtin_setjmp_frame_value ());
- mem = gen_rtx_MEM (Pmode, plus_constant (buf_addr, GET_MODE_SIZE (Pmode))),
+ mem = gen_rtx_MEM (Pmode, plus_constant (Pmode, buf_addr,
+ GET_MODE_SIZE (Pmode))),
set_mem_alias_set (mem, setjmp_alias_set);
emit_move_insn (validize_mem (mem),
force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, receiver_label)));
stack_save = gen_rtx_MEM (sa_mode,
- plus_constant (buf_addr,
+ plus_constant (Pmode, buf_addr,
2 * GET_MODE_SIZE (Pmode)));
set_mem_alias_set (stack_save, setjmp_alias_set);
emit_stack_save (SAVE_NONLOCAL, &stack_save);
@@ -1007,10 +1008,10 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
#endif
{
fp = gen_rtx_MEM (Pmode, buf_addr);
- lab = gen_rtx_MEM (Pmode, plus_constant (buf_addr,
+ lab = gen_rtx_MEM (Pmode, plus_constant (Pmode, buf_addr,
GET_MODE_SIZE (Pmode)));
- stack = gen_rtx_MEM (sa_mode, plus_constant (buf_addr,
+ stack = gen_rtx_MEM (sa_mode, plus_constant (Pmode, buf_addr,
2 * GET_MODE_SIZE (Pmode)));
set_mem_alias_set (fp, setjmp_alias_set);
set_mem_alias_set (lab, setjmp_alias_set);
@@ -1084,7 +1085,8 @@ expand_builtin_nonlocal_goto (tree exp)
r_save_area = copy_to_reg (r_save_area);
r_fp = gen_rtx_MEM (Pmode, r_save_area);
r_sp = gen_rtx_MEM (STACK_SAVEAREA_MODE (SAVE_NONLOCAL),
- plus_constant (r_save_area, GET_MODE_SIZE (Pmode)));
+ plus_constant (Pmode, r_save_area,
+ GET_MODE_SIZE (Pmode)));
crtl->has_nonlocal_goto = 1;
@@ -1154,7 +1156,8 @@ expand_builtin_update_setjmp_buf (rtx buf_addr)
= gen_rtx_MEM (sa_mode,
memory_address
(sa_mode,
- plus_constant (buf_addr, 2 * GET_MODE_SIZE (Pmode))));
+ plus_constant (Pmode, buf_addr,
+ 2 * GET_MODE_SIZE (Pmode))));
emit_stack_save (SAVE_NONLOCAL, &stack_save);
}
@@ -1539,7 +1542,7 @@ expand_builtin_apply_args_1 (void)
as we might have pretended they were passed. Make sure it's a valid
operand, as emit_move_insn isn't expected to handle a PLUS. */
tem
- = force_operand (plus_constant (tem, crtl->args.pretend_args_size),
+ = force_operand (plus_constant (Pmode, tem, crtl->args.pretend_args_size),
NULL_RTX);
#endif
emit_move_insn (adjust_address (registers, Pmode, 0), tem);
@@ -1660,7 +1663,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
dest = virtual_outgoing_args_rtx;
#ifndef STACK_GROWS_DOWNWARD
if (CONST_INT_P (argsize))
- dest = plus_constant (dest, -INTVAL (argsize));
+ dest = plus_constant (Pmode, dest, -INTVAL (argsize));
else
dest = gen_rtx_PLUS (Pmode, dest, negate_rtx (Pmode, argsize));
#endif
@@ -3352,7 +3355,8 @@ expand_movstr (tree dest, tree src, rtx target, int endp)
adjust it. */
if (endp == 1)
{
- rtx tem = plus_constant (gen_lowpart (GET_MODE (target), target), 1);
+ rtx tem = plus_constant (GET_MODE (target),
+ gen_lowpart (GET_MODE (target), target), 1);
emit_move_insn (target, force_operand (tem, NULL_RTX));
}
}
@@ -3451,7 +3455,7 @@ expand_builtin_stpcpy (tree exp, rtx target, enum machine_mode mode)
if (GET_MODE (target) != GET_MODE (ret))
ret = gen_lowpart (GET_MODE (target), ret);
- ret = plus_constant (ret, INTVAL (len_rtx));
+ ret = plus_constant (GET_MODE (ret), ret, INTVAL (len_rtx));
ret = emit_move_insn (target, force_operand (ret, NULL_RTX));
gcc_assert (ret);
diff --git a/gcc/calls.c b/gcc/calls.c
index 8c1e079..a01c423 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -868,6 +868,7 @@ save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_sa
int num_to_save;
enum machine_mode save_mode;
int delta;
+ rtx addr;
rtx stack_area;
rtx save_area;
@@ -891,10 +892,8 @@ save_fixed_argument_area (int reg_parm_stack_space, rtx argblock, int *low_to_sa
#else
delta = low;
#endif
- stack_area = gen_rtx_MEM (save_mode,
- memory_address (save_mode,
- plus_constant (argblock,
- delta)));
+ addr = plus_constant (Pmode, argblock, delta);
+ stack_area = gen_rtx_MEM (save_mode, memory_address (save_mode, addr));
set_mem_align (stack_area, PARM_BOUNDARY);
if (save_mode == BLKmode)
@@ -920,16 +919,15 @@ restore_fixed_argument_area (rtx save_area, rtx argblock, int high_to_save, int
{
enum machine_mode save_mode = GET_MODE (save_area);
int delta;
- rtx stack_area;
+ rtx addr, stack_area;
#ifdef ARGS_GROW_DOWNWARD
delta = -high_to_save;
#else
delta = low_to_save;
#endif
- stack_area = gen_rtx_MEM (save_mode,
- memory_address (save_mode,
- plus_constant (argblock, delta)));
+ addr = plus_constant (Pmode, argblock, delta);
+ stack_area = gen_rtx_MEM (save_mode, memory_address (save_mode, addr));
set_mem_align (stack_area, PARM_BOUNDARY);
if (save_mode != BLKmode)
@@ -1560,11 +1558,11 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals
continue;
if (CONST_INT_P (offset))
- addr = plus_constant (arg_reg, INTVAL (offset));
+ addr = plus_constant (Pmode, arg_reg, INTVAL (offset));
else
addr = gen_rtx_PLUS (Pmode, arg_reg, offset);
- addr = plus_constant (addr, arg_offset);
+ addr = plus_constant (Pmode, addr, arg_offset);
if (args[i].partial != 0)
{
@@ -1594,11 +1592,11 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals
set_mem_align (args[i].stack, align);
if (CONST_INT_P (slot_offset))
- addr = plus_constant (arg_reg, INTVAL (slot_offset));
+ addr = plus_constant (Pmode, arg_reg, INTVAL (slot_offset));
else
addr = gen_rtx_PLUS (Pmode, arg_reg, slot_offset);
- addr = plus_constant (addr, arg_offset);
+ addr = plus_constant (Pmode, addr, arg_offset);
if (args[i].partial != 0)
{
@@ -1759,7 +1757,7 @@ internal_arg_pointer_based_exp (rtx rtl, bool toplevel)
rtx val = internal_arg_pointer_based_exp (XEXP (rtl, 0), toplevel);
if (val == NULL_RTX || val == pc_rtx)
return val;
- return plus_constant (val, INTVAL (XEXP (rtl, 1)));
+ return plus_constant (Pmode, val, INTVAL (XEXP (rtl, 1)));
}
/* When called at the topmost level, scan pseudo assignments in between the
@@ -2716,9 +2714,9 @@ expand_call (tree exp, rtx target, int ignore)
argblock = crtl->args.internal_arg_pointer;
argblock
#ifdef STACK_GROWS_DOWNWARD
- = plus_constant (argblock, crtl->args.pretend_args_size);
+ = plus_constant (Pmode, argblock, crtl->args.pretend_args_size);
#else
- = plus_constant (argblock, -crtl->args.pretend_args_size);
+ = plus_constant (Pmode, argblock, -crtl->args.pretend_args_size);
#endif
stored_args_map = sbitmap_alloc (args_size.constant);
sbitmap_zero (stored_args_map);
@@ -2853,7 +2851,7 @@ expand_call (tree exp, rtx target, int ignore)
{
argblock = push_block (GEN_INT (needed), 0, 0);
#ifdef ARGS_GROW_DOWNWARD
- argblock = plus_constant (argblock, needed);
+ argblock = plus_constant (Pmode, argblock, needed);
#endif
}
@@ -3890,7 +3888,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
use virtuals anyway, they won't match the rtl patterns. */
if (virtuals_instantiated)
- argblock = plus_constant (stack_pointer_rtx, STACK_POINTER_OFFSET);
+ argblock = plus_constant (Pmode, stack_pointer_rtx,
+ STACK_POINTER_OFFSET);
else
argblock = virtual_outgoing_args_rtx;
}
@@ -3976,7 +3975,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
enum machine_mode save_mode
= mode_for_size (size, MODE_INT, 1);
rtx adr
- = plus_constant (argblock,
+ = plus_constant (Pmode, argblock,
argvec[argnum].locate.offset.constant);
rtx stack_area
= gen_rtx_MEM (save_mode, memory_address (save_mode, adr));
@@ -4018,7 +4017,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* Indicate argument access so that alias.c knows that these
values are live. */
if (argblock)
- use = plus_constant (argblock,
+ use = plus_constant (Pmode, argblock,
argvec[argnum].locate.offset.constant);
else
/* When arguments are pushed, trying to tell alias.c where
@@ -4244,7 +4243,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (argvec[count].save_area)
{
enum machine_mode save_mode = GET_MODE (argvec[count].save_area);
- rtx adr = plus_constant (argblock,
+ rtx adr = plus_constant (Pmode, argblock,
argvec[count].locate.offset.constant);
rtx stack_area = gen_rtx_MEM (save_mode,
memory_address (save_mode, adr));
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 81392b6..126b132e 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -873,7 +873,7 @@ expand_one_stack_var_at (tree decl, rtx base, unsigned base_align,
/* If this fails, we've overflowed the stack frame. Error nicely? */
gcc_assert (offset == trunc_int_for_mode (offset, Pmode));
- x = plus_constant (base, offset);
+ x = plus_constant (Pmode, base, offset);
x = gen_rtx_MEM (DECL_MODE (SSAVAR (decl)), x);
if (TREE_CODE (decl) != SSA_NAME)
@@ -2836,6 +2836,7 @@ expand_debug_expr (tree exp)
}
/* FALLTHROUGH */
case INDIRECT_REF:
+ inner_mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0)
return NULL;
@@ -2853,7 +2854,7 @@ expand_debug_expr (tree exp)
if (!op1 || !CONST_INT_P (op1))
return NULL;
- op0 = plus_constant (op0, INTVAL (op1));
+ op0 = plus_constant (inner_mode, op0, INTVAL (op1));
}
if (POINTER_TYPE_P (TREE_TYPE (exp)))
@@ -3347,8 +3348,10 @@ expand_debug_expr (tree exp)
&& (bitoffset % BITS_PER_UNIT) == 0
&& bitsize > 0
&& bitsize == maxsize)
- return plus_constant (gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl),
- bitoffset / BITS_PER_UNIT);
+ {
+ rtx base = gen_rtx_DEBUG_IMPLICIT_PTR (mode, decl);
+ return plus_constant (mode, base, bitoffset / BITS_PER_UNIT);
+ }
}
return NULL;
diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
index 6b6f74b..27aca85 100644
--- a/gcc/combine-stack-adj.c
+++ b/gcc/combine-stack-adj.c
@@ -214,7 +214,8 @@ try_apply_stack_adjustment (rtx insn, struct csa_reflist *reflist,
for (ml = reflist; ml ; ml = ml->next)
{
- rtx new_addr = plus_constant (stack_pointer_rtx, ml->sp_offset - delta);
+ rtx new_addr = plus_constant (Pmode, stack_pointer_rtx,
+ ml->sp_offset - delta);
rtx new_val;
if (MEM_P (*ml->ref))
diff --git a/gcc/combine.c b/gcc/combine.c
index 7eaaf47..d2c6514 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5874,7 +5874,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
== GET_MODE_PRECISION (mode)))
{
op0 = expand_compound_operation (op0);
- return plus_constant (gen_lowpart (mode, op0), 1);
+ return plus_constant (mode, gen_lowpart (mode, op0), 1);
}
/* If STORE_FLAG_VALUE is -1, we have cases similar to
@@ -5923,7 +5923,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
&& nonzero_bits (op0, mode) == 1)
{
op0 = expand_compound_operation (op0);
- return plus_constant (gen_lowpart (mode, op0), -1);
+ return plus_constant (mode, gen_lowpart (mode, op0), -1);
}
/* If STORE_FLAG_VALUE says to just test the sign bit and X has just
@@ -8306,7 +8306,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
&& exact_log2 (- smask) >= 0
&& (nonzero_bits (XEXP (x, 0), mode) & ~smask) == 0
&& (INTVAL (XEXP (x, 1)) & ~smask) != 0)
- return force_to_mode (plus_constant (XEXP (x, 0),
+ return force_to_mode (plus_constant (GET_MODE (x), XEXP (x, 0),
(INTVAL (XEXP (x, 1)) & smask)),
mode, smask, next_select);
}
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index c52fc50..174abc2 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 194e9a2..8520ea8 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 d090634..e89ed27 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 73e45a5..6f90122f 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 4d11d7e..17b4b5d 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 0103c2b..b1ad3bf 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 af00aee..d52ab15 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 577f091..1342c56 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 cc3b14f..03759bf 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 4cb4ffb4..8a36889 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 65968f8..852c808 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 01577ca..54794e1 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 de9e269..40efd23 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 92657d1..b4ead76 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 15efaa3..10cbdc3 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 422fe2f..f1a8db7 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 b192153..22863e8 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 e6a3712..edb8dc4 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 1354d37..ace9e43 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 7eaaf20..f165fdf 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 1b8d074..953b668 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 bd4899b..ddb3645 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 9da00cc..f0725c7 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 c659506..89a65ff 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 7d8630e..e75eb2f 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 0d0ee5f..2e1cf44 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 5758647..79b03fa 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 9763670..b27a3a5 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 325faf7..8f5b505 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 6fbd700..8b21419 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 42d3779..0a390d0 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 8104e75..cc59d45 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 82ae0cf..9b8cf02 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 c56a0c6..805de2b 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 4351702..edfff54 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 8412d0e..b170606 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 d48a465..1e09f28 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 5d8f74f..912dccb 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 c87d09e..8f801e6 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 b5f3933..1554f94 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 d70eaac..8d40412 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 d2a455b..c80d26c 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 6b4ea25..56c889d 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 a69f2b8a..d0110e7 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 42e3af0..85ea46a 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 b878a1f..57cbd15 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 dca434b..9b6d898 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 561c623..c69a209 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 e7483e9..016c348 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 5592674..b338cd9 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 edc6399..99c09e8 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 ef1ab26..a467d4a 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 28a0265..0af0fd5 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 7dbbe1c..d863474 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 45a5edf..914d5bf 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 0db1718..4cb381e 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 a1919b4..a2bf09f 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 4c7a2b0..aafff55 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 c65d003..dc5ca45 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 d89bf49..ce0bc8e 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 99acee6..a2e6481 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 217682e..a23e193 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 081ecc1..ac69061 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 011ac08..2b18b4f 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 930612d..593bf68 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 5c43607..e2a72b0 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 bf3492e..4ac5653 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 8e5f4af..7796f34 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 4e704b6..aa929ca 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 0c83563..a9de79c 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 7f42e48..fa38008 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));
}
diff --git a/gcc/cse.c b/gcc/cse.c
index b7db827..a8df74b 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1258,7 +1258,7 @@ insert_const_anchor (HOST_WIDE_INT anchor, rtx reg, HOST_WIDE_INT offs,
if (!elt)
elt = insert (anchor_exp, NULL, hash, mode);
- exp = plus_constant (reg, offs);
+ exp = plus_constant (mode, reg, offs);
/* REG has just been inserted and the hash codes recomputed. */
mention_regs (exp);
hash = HASH (exp, mode);
@@ -1333,7 +1333,7 @@ find_reg_offset_for_const (struct table_elt *anchor_elt, HOST_WIDE_INT offs,
if (!REG_P (elt->exp) && !exp_equiv_p (elt->exp, elt->exp, 1, false))
continue;
- x = plus_constant (elt->exp, offs);
+ x = plus_constant (GET_MODE (elt->exp), elt->exp, offs);
if (REG_P (x)
|| (GET_CODE (x) == PLUS
&& IN_RANGE (INTVAL (XEXP (x, 1)),
@@ -2218,7 +2218,7 @@ use_related_value (rtx x, struct table_elt *elt)
offset = (get_integer_term (x) - get_integer_term (p->exp));
/* Note: OFFSET may be 0 if P->xexp and X are related by commutativity. */
- return plus_constant (q->exp, offset);
+ return plus_constant (q->mode, q->exp, offset);
}
@@ -3567,7 +3567,7 @@ fold_rtx (rtx x, rtx insn)
{
rtx y = lookup_as_function (XEXP (x, 0), PLUS);
if (y && CONST_INT_P (XEXP (y, 1)))
- return fold_rtx (plus_constant (copy_rtx (y),
+ return fold_rtx (plus_constant (mode, copy_rtx (y),
-INTVAL (const_arg1)),
NULL_RTX);
}
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 56f2b7f..5121277 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1866,7 +1866,8 @@ cselib_subst_to_values (rtx x, enum machine_mode memmode)
i = GET_MODE_SIZE (memmode);
if (code == PRE_DEC)
i = -i;
- return cselib_subst_to_values (plus_constant (XEXP (x, 0), i),
+ return cselib_subst_to_values (plus_constant (GET_MODE (x),
+ XEXP (x, 0), i),
memmode);
case PRE_MODIFY:
diff --git a/gcc/dse.c b/gcc/dse.c
index 19d9383..0523757 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1392,6 +1392,7 @@ record_store (rtx body, bb_info_t bb_info)
cselib_val *base = NULL;
insn_info_t ptr, last, redundant_reason;
bool store_is_unused;
+ enum machine_mode address_mode;
if (GET_CODE (body) != SET && GET_CODE (body) != CLOBBER)
return 0;
@@ -1454,6 +1455,8 @@ record_store (rtx body, bb_info_t bb_info)
return 0;
}
+ address_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem));
+
if (GET_MODE (mem) == BLKmode)
width = MEM_SIZE (mem);
else
@@ -1561,7 +1564,7 @@ record_store (rtx body, bb_info_t bb_info)
mem_addr = group->canon_base_addr;
}
if (offset)
- mem_addr = plus_constant (mem_addr, offset);
+ mem_addr = plus_constant (address_mode, mem_addr, offset);
}
while (ptr)
@@ -2178,7 +2181,11 @@ check_mem_read_rtx (rtx *loc, void *data)
mem_addr = group->canon_base_addr;
}
if (offset)
- mem_addr = plus_constant (mem_addr, offset);
+ {
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem));
+ mem_addr = plus_constant (address_mode, mem_addr, offset);
+ }
}
/* We ignore the clobbers in store_info. The is mildly aggressive,
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 80abb2e..8da10f2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -14286,11 +14286,12 @@ rtl_for_decl_location (tree decl)
&& (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl)))
< UNITS_PER_WORD))
{
+ enum machine_mode addr_mode = get_address_mode (rtl);
int offset = (UNITS_PER_WORD
- GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl))));
rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)),
- plus_constant (XEXP (rtl, 0), offset));
+ plus_constant (addr_mode, XEXP (rtl, 0), offset));
}
}
else if (TREE_CODE (decl) == VAR_DECL
@@ -14299,6 +14300,7 @@ rtl_for_decl_location (tree decl)
&& GET_MODE (rtl) != TYPE_MODE (TREE_TYPE (decl))
&& BYTES_BIG_ENDIAN)
{
+ enum machine_mode addr_mode = get_address_mode (rtl);
int rsize = GET_MODE_SIZE (GET_MODE (rtl));
int dsize = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (decl)));
@@ -14310,7 +14312,8 @@ rtl_for_decl_location (tree decl)
else gdb will not be able to display it. */
if (rsize > dsize)
rtl = gen_rtx_MEM (TYPE_MODE (TREE_TYPE (decl)),
- plus_constant (XEXP (rtl, 0), rsize-dsize));
+ plus_constant (addr_mode, XEXP (rtl, 0),
+ rsize - dsize));
}
/* A variable with no DECL_RTL but a DECL_INITIAL is a compile-time constant,
@@ -17267,10 +17270,13 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
&& loc->expr->dw_loc_next == NULL
&& GET_CODE (loc->expr->dw_loc_oprnd1.v.val_addr)
== SYMBOL_REF)
- loc->expr->dw_loc_oprnd1.v.val_addr
- = plus_constant (loc->expr->dw_loc_oprnd1.v.val_addr, off);
- else
- loc_list_plus_const (loc, off);
+ {
+ rtx x = loc->expr->dw_loc_oprnd1.v.val_addr;
+ loc->expr->dw_loc_oprnd1.v.val_addr
+ = plus_constant (GET_MODE (x), x , off);
+ }
+ else
+ loc_list_plus_const (loc, off);
}
add_AT_location_description (var_die, DW_AT_location, loc);
remove_AT (var_die, DW_AT_declaration);
@@ -17330,8 +17336,11 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
&& loc->expr->dw_loc_opc == DW_OP_addr
&& loc->expr->dw_loc_next == NULL
&& GET_CODE (loc->expr->dw_loc_oprnd1.v.val_addr) == SYMBOL_REF)
- loc->expr->dw_loc_oprnd1.v.val_addr
- = plus_constant (loc->expr->dw_loc_oprnd1.v.val_addr, off);
+ {
+ rtx x = loc->expr->dw_loc_oprnd1.v.val_addr;
+ loc->expr->dw_loc_oprnd1.v.val_addr
+ = plus_constant (GET_MODE (x), x, off);
+ }
else
loc_list_plus_const (loc, off);
}
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9da585c..25c8ded 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2110,9 +2110,10 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset,
&& (unsigned HOST_WIDE_INT) offset
< GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
addr = gen_rtx_LO_SUM (address_mode, XEXP (addr, 0),
- plus_constant (XEXP (addr, 1), offset));
+ plus_constant (address_mode,
+ XEXP (addr, 1), offset));
else
- addr = plus_constant (addr, offset);
+ addr = plus_constant (address_mode, addr, offset);
}
new_rtx = change_address_1 (memref, mode, addr, validate);
diff --git a/gcc/except.c b/gcc/except.c
index 254dd8c..158ca20 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1155,7 +1155,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
rtx x, last;
x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_RETURNS_TWICE,
TYPE_MODE (integer_type_node), 1,
- plus_constant (XEXP (fc, 0),
+ plus_constant (Pmode, XEXP (fc, 0),
sjlj_fc_jbuf_ofs), Pmode);
emit_cmp_and_jump_insns (x, const0_rtx, NE, 0,
@@ -1168,7 +1168,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
add_reg_note (last, REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE / 100));
}
#else
- expand_builtin_setjmp_setup (plus_constant (XEXP (fc, 0),
+ expand_builtin_setjmp_setup (plus_constant (Pmode, XEXP (fc, 0),
sjlj_fc_jbuf_ofs),
dispatch_label);
#endif
@@ -2094,7 +2094,7 @@ expand_builtin_extract_return_addr (tree addr_tree)
/* Then adjust to find the real return address. */
#if defined (RETURN_ADDR_OFFSET)
- addr = plus_constant (addr, RETURN_ADDR_OFFSET);
+ addr = plus_constant (Pmode, addr, RETURN_ADDR_OFFSET);
#endif
return addr;
@@ -2113,7 +2113,7 @@ expand_builtin_frob_return_addr (tree addr_tree)
#ifdef RETURN_ADDR_OFFSET
addr = force_reg (Pmode, addr);
- addr = plus_constant (addr, -RETURN_ADDR_OFFSET);
+ addr = plus_constant (Pmode, addr, -RETURN_ADDR_OFFSET);
#endif
return addr;
diff --git a/gcc/explow.c b/gcc/explow.c
index ff26dbf..cc4391c 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -75,22 +75,18 @@ trunc_int_for_mode (HOST_WIDE_INT c, enum machine_mode mode)
}
/* Return an rtx for the sum of X and the integer C, given that X has
- mode MODE. This routine should be used instead of plus_constant
- when they want to ensure that addition happens in a particular
- mode, which is necessary when X can be a VOIDmode CONST_INT or
- CONST_DOUBLE and the width of the constant is different from the
- width of the expression. */
-/* TODO: All callers of plus_constant should migrate to this routine,
- and once they do, we can assert that mode is not VOIDmode. */
+ mode MODE. */
rtx
-plus_constant_mode (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
+plus_constant (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
{
RTX_CODE code;
rtx y;
rtx tem;
int all_constant = 0;
+ gcc_assert (GET_MODE (x) == VOIDmode || GET_MODE (x) == mode);
+
if (c == 0)
return x;
@@ -143,7 +139,7 @@ plus_constant_mode (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
{
- tem = plus_constant_mode (mode, get_pool_constant (XEXP (x, 0)), c);
+ tem = plus_constant (mode, get_pool_constant (XEXP (x, 0)), c);
tem = force_const_mem (GET_MODE (x), tem);
if (memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
return tem;
@@ -173,7 +169,8 @@ plus_constant_mode (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
if (CONSTANT_P (XEXP (x, 1)))
{
- x = gen_rtx_PLUS (mode, XEXP (x, 0), plus_constant_mode (mode, XEXP (x, 1), c));
+ x = gen_rtx_PLUS (mode, XEXP (x, 0),
+ plus_constant (mode, XEXP (x, 1), c));
c = 0;
}
else if (find_constant_term_loc (&y))
@@ -183,7 +180,7 @@ plus_constant_mode (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
rtx copy = copy_rtx (x);
rtx *const_loc = find_constant_term_loc (&copy);
- *const_loc = plus_constant_mode (mode, *const_loc, c);
+ *const_loc = plus_constant (mode, *const_loc, c);
x = copy;
c = 0;
}
@@ -203,14 +200,6 @@ plus_constant_mode (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
else
return x;
}
-
-/* Return an rtx for the sum of X and the integer C. */
-
-rtx
-plus_constant (rtx x, HOST_WIDE_INT c)
-{
- return plus_constant_mode (GET_MODE (x), x, c);
-}
/* If X is a sum, return a new sum like X but lacking any constant terms.
Add all the removed constant terms into *CONSTPTR.
@@ -567,6 +556,7 @@ use_anchored_address (rtx x)
{
rtx base;
HOST_WIDE_INT offset;
+ enum machine_mode mode;
if (!flag_section_anchors)
return x;
@@ -607,10 +597,11 @@ use_anchored_address (rtx x)
/* If we're going to run a CSE pass, force the anchor into a register.
We will then be able to reuse registers for several accesses, if the
target costs say that that's worthwhile. */
+ mode = GET_MODE (base);
if (!cse_not_expected)
- base = force_reg (GET_MODE (base), base);
+ base = force_reg (mode, base);
- return replace_equiv_address (x, plus_constant (base, offset));
+ return replace_equiv_address (x, plus_constant (mode, base, offset));
}
/* Copy the value or contents of X to a new temp reg and return that reg. */
@@ -995,7 +986,8 @@ round_push (rtx size)
substituted by the right value in vregs pass and optimized
during combine. */
align_rtx = virtual_preferred_stack_boundary_rtx;
- alignm1_rtx = force_operand (plus_constant (align_rtx, -1), NULL_RTX);
+ alignm1_rtx = force_operand (plus_constant (Pmode, align_rtx, -1),
+ NULL_RTX);
}
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
@@ -1285,7 +1277,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
{
unsigned extra = (required_align - extra_align) / BITS_PER_UNIT;
- size = plus_constant (size, extra);
+ size = plus_constant (Pmode, size, extra);
size = force_operand (size, NULL_RTX);
if (flag_stack_usage_info)
@@ -1576,7 +1568,8 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
rtx addr = memory_address (Pmode,
gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
stack_pointer_rtx,
- plus_constant (size, first)));
+ plus_constant (Pmode,
+ size, first)));
emit_library_call (stack_check_libfunc, LCT_NORMAL, VOIDmode, 1, addr,
Pmode);
return;
@@ -1590,7 +1583,8 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
rtx addr = memory_address (Pmode,
gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
stack_pointer_rtx,
- plus_constant (size, first)));
+ plus_constant (Pmode,
+ size, first)));
create_input_operand (&ops[0], addr, Pmode);
if (maybe_expand_insn (CODE_FOR_check_stack, 1, ops))
@@ -1611,13 +1605,13 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
for (i = PROBE_INTERVAL; i < isize; i += PROBE_INTERVAL)
{
addr = memory_address (Pmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
STACK_GROW_OFF (first + i)));
emit_stack_probe (addr);
}
addr = memory_address (Pmode,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
STACK_GROW_OFF (first + isize)));
emit_stack_probe (addr);
}
@@ -1701,7 +1695,7 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
/* Use [base + disp} addressing mode if supported. */
HOST_WIDE_INT offset = INTVAL (temp);
addr = memory_address (Pmode,
- plus_constant (last_addr,
+ plus_constant (Pmode, last_addr,
STACK_GROW_OFF (offset)));
}
else
@@ -1759,9 +1753,9 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
}
if (first_probe)
- anti_adjust_stack (plus_constant (size, PROBE_INTERVAL + dope));
+ anti_adjust_stack (plus_constant (Pmode, size, PROBE_INTERVAL + dope));
else
- anti_adjust_stack (plus_constant (size, PROBE_INTERVAL - i));
+ anti_adjust_stack (plus_constant (Pmode, size, PROBE_INTERVAL - i));
emit_stack_probe (stack_pointer_rtx);
}
@@ -1839,7 +1833,7 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
/* Adjust back and account for the additional first interval. */
if (adjust_back)
- adjust_stack (plus_constant (size, PROBE_INTERVAL + dope));
+ adjust_stack (plus_constant (Pmode, size, PROBE_INTERVAL + dope));
else
adjust_stack (GEN_INT (PROBE_INTERVAL + dope));
}
diff --git a/gcc/expmed.c b/gcc/expmed.c
index a0a0960..45b150e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -4786,7 +4786,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
remainder = expand_binop (compute_mode, sub_optab, op0, tem,
remainder, 1, OPTAB_LIB_WIDEN);
}
- tem = plus_constant (op1, -1);
+ tem = plus_constant (compute_mode, op1, -1);
tem = expand_shift (RSHIFT_EXPR, compute_mode, tem, 1, NULL_RTX, 1);
do_cmp_and_jump (remainder, tem, LEU, compute_mode, label);
expand_inc (quotient, const1_rtx);
diff --git a/gcc/expr.c b/gcc/expr.c
index 1e0e96a..fa512a2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -927,7 +927,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (USE_LOAD_PRE_DECREMENT (mode) && data.reverse && ! data.autinc_from)
{
data.from_addr = copy_to_mode_reg (from_addr_mode,
- plus_constant (from_addr, len));
+ plus_constant (from_addr_mode,
+ from_addr, len));
data.autinc_from = 1;
data.explicit_inc_from = -1;
}
@@ -942,7 +943,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
if (USE_STORE_PRE_DECREMENT (mode) && data.reverse && ! data.autinc_to)
{
data.to_addr = copy_to_mode_reg (to_addr_mode,
- plus_constant (to_addr, len));
+ plus_constant (to_addr_mode,
+ to_addr, len));
data.autinc_to = 1;
data.explicit_inc_to = -1;
}
@@ -991,7 +993,8 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
emit_insn (gen_add2_insn (data.to_addr, constm1_rtx));
else
data.to_addr = copy_to_mode_reg (to_addr_mode,
- plus_constant (data.to_addr,
+ plus_constant (to_addr_mode,
+ data.to_addr,
-1));
}
to1 = adjust_automodify_address (data.to, QImode, data.to_addr,
@@ -2492,7 +2495,8 @@ store_by_pieces (rtx to, unsigned HOST_WIDE_INT len,
emit_insn (gen_add2_insn (data.to_addr, constm1_rtx));
else
data.to_addr = copy_to_mode_reg (to_addr_mode,
- plus_constant (data.to_addr,
+ plus_constant (to_addr_mode,
+ data.to_addr,
-1));
}
to1 = adjust_automodify_address (data.to, QImode, data.to_addr,
@@ -2580,7 +2584,9 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
if (USE_STORE_PRE_DECREMENT (mode) && data->reverse && ! data->autinc_to)
{
data->to_addr = copy_to_mode_reg (to_addr_mode,
- plus_constant (to_addr, data->len));
+ plus_constant (to_addr_mode,
+ to_addr,
+ data->len));
data->autinc_to = 1;
data->explicit_inc_to = -1;
}
@@ -3115,7 +3121,7 @@ emit_move_resolve_push (enum machine_mode mode, rtx x)
case POST_INC:
case POST_DEC:
case POST_MODIFY:
- temp = plus_constant (stack_pointer_rtx, -adjust);
+ temp = plus_constant (Pmode, stack_pointer_rtx, -adjust);
break;
default:
gcc_unreachable ();
@@ -3595,7 +3601,7 @@ push_block (rtx size, int extra, int below)
size = convert_modes (Pmode, ptr_mode, size, 1);
if (CONSTANT_P (size))
- anti_adjust_stack (plus_constant (size, extra));
+ anti_adjust_stack (plus_constant (Pmode, size, extra));
else if (REG_P (size) && extra == 0)
anti_adjust_stack (size);
else
@@ -3615,16 +3621,17 @@ push_block (rtx size, int extra, int below)
{
temp = virtual_outgoing_args_rtx;
if (extra != 0 && below)
- temp = plus_constant (temp, extra);
+ temp = plus_constant (Pmode, temp, extra);
}
else
{
if (CONST_INT_P (size))
- temp = plus_constant (virtual_outgoing_args_rtx,
+ temp = plus_constant (Pmode, virtual_outgoing_args_rtx,
-INTVAL (size) - (below ? 0 : extra));
else if (extra != 0 && !below)
temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
- negate_rtx (Pmode, plus_constant (size, extra)));
+ negate_rtx (Pmode, plus_constant (Pmode, size,
+ extra)));
else
temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
negate_rtx (Pmode, size));
@@ -4097,11 +4104,12 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
}
else if (CONST_INT_P (args_so_far))
temp = memory_address (BLKmode,
- plus_constant (args_addr,
+ plus_constant (Pmode, args_addr,
skip + INTVAL (args_so_far)));
else
temp = memory_address (BLKmode,
- plus_constant (gen_rtx_PLUS (Pmode,
+ plus_constant (Pmode,
+ gen_rtx_PLUS (Pmode,
args_addr,
args_so_far),
skip));
@@ -4214,7 +4222,7 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
if (CONST_INT_P (args_so_far))
addr
= memory_address (mode,
- plus_constant (args_addr,
+ plus_constant (Pmode, args_addr,
INTVAL (args_so_far)));
else
addr = memory_address (mode, gen_rtx_PLUS (Pmode, args_addr,
@@ -5264,7 +5272,8 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
Do all calculations in pointer_mode. */
if (CONST_INT_P (copy_size_rtx))
{
- size = plus_constant (size, -INTVAL (copy_size_rtx));
+ size = plus_constant (address_mode, size,
+ -INTVAL (copy_size_rtx));
target = adjust_address (target, BLKmode,
INTVAL (copy_size_rtx));
}
@@ -7628,7 +7637,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
of such an object. */
gcc_assert ((bitpos % BITS_PER_UNIT) == 0);
- result = plus_constant (result, bitpos / BITS_PER_UNIT);
+ result = plus_constant (tmode, result, bitpos / BITS_PER_UNIT);
if (modifier < EXPAND_SUM)
result = force_operand (result, target);
}
@@ -8223,7 +8232,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
= immed_double_const (TREE_INT_CST_LOW (treeop0),
(HOST_WIDE_INT) 0,
TYPE_MODE (TREE_TYPE (treeop1)));
- op1 = plus_constant (op1, INTVAL (constant_part));
+ op1 = plus_constant (mode, op1, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op1 = force_operand (op1, target);
return REDUCE_BIT_FIELD (op1);
@@ -8256,7 +8265,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
= immed_double_const (TREE_INT_CST_LOW (treeop1),
(HOST_WIDE_INT) 0,
TYPE_MODE (TREE_TYPE (treeop0)));
- op0 = plus_constant (op0, INTVAL (constant_part));
+ op0 = plus_constant (mode, op0, INTVAL (constant_part));
if (modifier != EXPAND_SUM && modifier != EXPAND_INITIALIZER)
op0 = force_operand (op0, target);
return REDUCE_BIT_FIELD (op0);
@@ -8318,7 +8327,8 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
/* If the last operand is a CONST_INT, use plus_constant of
the negated constant. Else make the MINUS. */
if (CONST_INT_P (op1))
- return REDUCE_BIT_FIELD (plus_constant (op0, - INTVAL (op1)));
+ return REDUCE_BIT_FIELD (plus_constant (mode, op0,
+ -INTVAL (op1)));
else
return REDUCE_BIT_FIELD (gen_rtx_MINUS (mode, op0, op1));
}
diff --git a/gcc/function.c b/gcc/function.c
index 3e903ef..b5e9011 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -496,12 +496,12 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size,
/* If we have already instantiated virtual registers, return the actual
address relative to the frame pointer. */
if (virtuals_instantiated)
- addr = plus_constant (frame_pointer_rtx,
+ addr = plus_constant (Pmode, frame_pointer_rtx,
trunc_int_for_mode
(slot_offset + bigend_correction
+ STARTING_FRAME_OFFSET, Pmode));
else
- addr = plus_constant (virtual_stack_vars_rtx,
+ addr = plus_constant (Pmode, virtual_stack_vars_rtx,
trunc_int_for_mode
(slot_offset + bigend_correction,
Pmode));
@@ -1449,7 +1449,7 @@ instantiate_virtual_regs_in_rtx (rtx *loc, void *data)
new_rtx = instantiate_new_reg (x, &offset);
if (new_rtx)
{
- *loc = plus_constant (new_rtx, offset);
+ *loc = plus_constant (GET_MODE (x), new_rtx, offset);
if (changed)
*changed = true;
}
@@ -1459,7 +1459,7 @@ instantiate_virtual_regs_in_rtx (rtx *loc, void *data)
new_rtx = instantiate_new_reg (XEXP (x, 0), &offset);
if (new_rtx)
{
- new_rtx = plus_constant (new_rtx, offset);
+ new_rtx = plus_constant (GET_MODE (x), new_rtx, offset);
*loc = simplify_gen_binary (PLUS, GET_MODE (x), new_rtx, XEXP (x, 1));
if (changed)
*changed = true;
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 7ef513a..f8c5de7 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -4152,6 +4152,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
if (!SCALAR_FLOAT_MODE_P (mode))
{
rtx result;
+ enum machine_mode ret_mode;
/* Handle a libcall just for the mode we are using. */
libfunc = optab_libfunc (cmp_optab, mode);
@@ -4166,9 +4167,9 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
libfunc = ulibfunc;
}
+ ret_mode = targetm.libgcc_cmp_return_mode ();
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- targetm.libgcc_cmp_return_mode (),
- 2, x, mode, y, mode);
+ ret_mode, 2, x, mode, y, mode);
/* There are two kinds of comparison routines. Biased routines
return 0/1/2, and unbiased routines return -1/0/1. Other parts
@@ -4186,7 +4187,7 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
if (!TARGET_LIB_INT_CMP_BIASED && !ALL_FIXED_POINT_MODE_P (mode))
{
if (unsignedp)
- x = plus_constant (result, 1);
+ x = plus_constant (ret_mode, result, 1);
else
y = const0_rtx;
}
diff --git a/gcc/recog.c b/gcc/recog.c
index 3f6bc54..c5725d2 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1969,7 +1969,7 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
int good;
y1 = *y2;
- *y2 = plus_constant (*y2, mode_sz - 1);
+ *y2 = plus_constant (GET_MODE (y), *y2, mode_sz - 1);
/* Use QImode because an odd displacement may be automatically invalid
for any wider mode. But it should be valid for a single byte. */
good = (*addressp) (QImode, y, as);
@@ -1991,9 +1991,10 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y,
&& mode != BLKmode
&& mode_sz <= GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT)
z = gen_rtx_LO_SUM (GET_MODE (y), XEXP (y, 0),
- plus_constant (XEXP (y, 1), mode_sz - 1));
+ plus_constant (GET_MODE (y), XEXP (y, 1),
+ mode_sz - 1));
else
- z = plus_constant (y, mode_sz - 1);
+ z = plus_constant (GET_MODE (y), y, mode_sz - 1);
/* Use QImode because an odd displacement may be automatically invalid
for any wider mode. But it should be valid for a single byte. */
diff --git a/gcc/reload.c b/gcc/reload.c
index 9eddc4d..bcc7750 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5196,7 +5196,8 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
rtx offset_reg;
enum reg_class cls;
- offset_reg = plus_constant (operand, INTVAL (XEXP (ad, 1)));
+ offset_reg = plus_constant (GET_MODE (ad), operand,
+ INTVAL (XEXP (ad, 1)));
/* Form the adjusted address. */
if (GET_CODE (XEXP (ad, 0)) == PLUS)
@@ -5363,9 +5364,9 @@ form_sum (enum machine_mode mode, rtx x, rtx y)
gcc_assert (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode);
if (CONST_INT_P (x))
- return plus_constant (y, INTVAL (x));
+ return plus_constant (mode, y, INTVAL (x));
else if (CONST_INT_P (y))
- return plus_constant (x, INTVAL (y));
+ return plus_constant (mode, x, INTVAL (y));
else if (CONSTANT_P (x))
tem = x, x = y, y = tem;
@@ -6161,7 +6162,8 @@ find_reloads_subreg_address (rtx x, int force_replace, int opnum,
else
offset = SUBREG_BYTE (x);
- XEXP (tem, 0) = plus_constant (XEXP (tem, 0), offset);
+ XEXP (tem, 0) = plus_constant (GET_MODE (XEXP (tem, 0)),
+ XEXP (tem, 0), offset);
PUT_MODE (tem, GET_MODE (x));
if (MEM_OFFSET_KNOWN_P (tem))
set_mem_offset (tem, MEM_OFFSET (tem) + offset);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 359a893..c887614 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -462,7 +462,7 @@ init_reload (void)
gen_rtx_REG (Pmode, i));
/* This way, we make sure that reg+reg is an offsettable address. */
- tem = plus_constant (tem, 4);
+ tem = plus_constant (Pmode, tem, 4);
if (memory_address_p (QImode, tem))
{
@@ -2590,7 +2590,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
ep++)
if (ep->from_rtx == x && ep->can_eliminate)
- return plus_constant (ep->to_rtx, ep->previous_offset);
+ return plus_constant (Pmode, ep->to_rtx, ep->previous_offset);
}
else if (reg_renumber && reg_renumber[regno] < 0
@@ -2646,7 +2646,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
return ep->to_rtx;
else
return gen_rtx_PLUS (Pmode, ep->to_rtx,
- plus_constant (XEXP (x, 1),
+ plus_constant (Pmode, XEXP (x, 1),
ep->previous_offset));
}
@@ -2723,7 +2723,8 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
ep->ref_outside_mem = 1;
return
- plus_constant (gen_rtx_MULT (Pmode, ep->to_rtx, XEXP (x, 1)),
+ plus_constant (Pmode,
+ gen_rtx_MULT (Pmode, ep->to_rtx, XEXP (x, 1)),
ep->previous_offset * INTVAL (XEXP (x, 1)));
}
@@ -3297,8 +3298,8 @@ eliminate_regs_in_insn (rtx insn, int replace)
if (base == ep->to_rtx)
{
- rtx src
- = plus_constant (ep->to_rtx, offset - ep->offset);
+ rtx src = plus_constant (Pmode, ep->to_rtx,
+ offset - ep->offset);
new_body = old_body;
if (! replace)
@@ -3412,7 +3413,8 @@ eliminate_regs_in_insn (rtx insn, int replace)
had a PLUS before. */
if (offset == 0 || plus_src)
{
- rtx new_src = plus_constant (to_rtx, offset);
+ rtx new_src = plus_constant (GET_MODE (to_rtx),
+ to_rtx, offset);
new_body = old_body;
if (! replace)
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 86c56ac..8883b8a 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1643,8 +1643,7 @@ extern int ceil_log2 (unsigned HOST_WIDE_INT);
/* In explow.c */
extern HOST_WIDE_INT trunc_int_for_mode (HOST_WIDE_INT, enum machine_mode);
-extern rtx plus_constant (rtx, HOST_WIDE_INT);
-extern rtx plus_constant_mode (enum machine_mode, rtx, HOST_WIDE_INT);
+extern rtx plus_constant (enum machine_mode, rtx, HOST_WIDE_INT);
/* In rtl.c */
extern rtx rtx_alloc_stat (RTX_CODE MEM_STAT_DECL);
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 3357ceb..6b0d56e 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -613,7 +613,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
/* Similarly, (not (neg X)) is (plus X -1). */
if (GET_CODE (op) == NEG)
- return plus_constant (XEXP (op, 0), -1);
+ return plus_constant (mode, XEXP (op, 0), -1);
/* (not (xor X C)) for C constant is (xor X D) with D = ~C. */
if (GET_CODE (op) == XOR
@@ -713,7 +713,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
/* Similarly, (neg (not X)) is (plus X 1). */
if (GET_CODE (op) == NOT)
- return plus_constant (XEXP (op, 0), 1);
+ return plus_constant (mode, XEXP (op, 0), 1);
/* (neg (minus X Y)) can become (minus Y X). This transformation
isn't safe for modes with signed zeros, since if X and Y are
@@ -782,7 +782,7 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
if (GET_CODE (op) == XOR
&& XEXP (op, 1) == const1_rtx
&& nonzero_bits (XEXP (op, 0), mode) == 1)
- return plus_constant (XEXP (op, 0), -1);
+ return plus_constant (mode, XEXP (op, 0), -1);
/* (neg (lt x 0)) is (ashiftrt X C) if STORE_FLAG_VALUE is 1. */
/* (neg (lt x 0)) is (lshiftrt X C) if STORE_FLAG_VALUE is -1. */
@@ -1954,12 +1954,12 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
|| GET_CODE (op0) == SYMBOL_REF
|| GET_CODE (op0) == LABEL_REF)
&& CONST_INT_P (op1))
- return plus_constant (op0, INTVAL (op1));
+ return plus_constant (mode, op0, INTVAL (op1));
else if ((GET_CODE (op1) == CONST
|| GET_CODE (op1) == SYMBOL_REF
|| GET_CODE (op1) == LABEL_REF)
&& CONST_INT_P (op0))
- return plus_constant (op1, INTVAL (op0));
+ return plus_constant (mode, op1, INTVAL (op0));
/* See if this is something like X * C - X or vice versa or
if the multiplication is written as a shift. If so, we can
@@ -2557,7 +2557,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
if (mask >> count == INTVAL (trueop1)
&& (mask & nonzero_bits (XEXP (op0, 0), mode)) == 0)
return simplify_gen_binary (ASHIFTRT, mode,
- plus_constant (XEXP (op0, 0), mask),
+ plus_constant (mode, XEXP (op0, 0),
+ mask),
XEXP (op0, 1));
}
@@ -4118,7 +4119,8 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0,
rtx value = ops[n_ops - 1].op;
if (ops[n_ops - 1].neg ^ ops[n_ops - 2].neg)
value = neg_const_int (mode, value);
- ops[n_ops - 2].op = plus_constant (ops[n_ops - 2].op, INTVAL (value));
+ ops[n_ops - 2].op = plus_constant (mode, ops[n_ops - 2].op,
+ INTVAL (value));
n_ops--;
}
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index c3fe428..da09e6b 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -811,7 +811,7 @@ static HOST_WIDE_INT cfa_base_offset;
static inline rtx
compute_cfa_pointer (HOST_WIDE_INT adjustment)
{
- return plus_constant (cfa_base_rtx, adjustment + cfa_base_offset);
+ return plus_constant (Pmode, cfa_base_rtx, adjustment + cfa_base_offset);
}
/* Adjustment for hard_frame_pointer_rtx to cfa base reg,
@@ -5982,7 +5982,8 @@ prepare_call_arguments (basic_block bb, rtx insn)
HOST_WIDE_INT token
= tree_low_cst (OBJ_TYPE_REF_TOKEN (obj_type_ref), 0);
if (token)
- clobbered = plus_constant (clobbered, token * GET_MODE_SIZE (mode));
+ clobbered = plus_constant (mode, clobbered,
+ token * GET_MODE_SIZE (mode));
clobbered = gen_rtx_MEM (mode, clobbered);
x = gen_rtx_CONCAT (mode, gen_rtx_CLOBBER (VOIDmode, pc_rtx), clobbered);
call_arguments
@@ -9021,7 +9022,8 @@ vt_add_function_parameter (tree parm)
off += INTVAL (XEXP (XEXP (incoming, 0), 1));
incoming
= replace_equiv_address_nv (incoming,
- plus_constant (arg_pointer_rtx, off));
+ plus_constant (Pmode,
+ arg_pointer_rtx, off));
}
#ifdef HAVE_window_save