aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index c15d47d..abee364 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3314,6 +3314,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
set_mem_attributes (parmreg, parm, 1);
}
+ /* We need to preserve an address based on VIRTUAL_STACK_VARS_REGNUM for
+ the debug info in case it is not legitimate. */
if (GET_MODE (parmreg) != GET_MODE (rtl))
{
rtx tempreg = gen_reg_rtx (GET_MODE (rtl));
@@ -3323,7 +3325,8 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
all->last_conversion_insn);
emit_move_insn (tempreg, rtl);
tempreg = convert_to_mode (GET_MODE (parmreg), tempreg, unsigned_p);
- emit_move_insn (parmreg, tempreg);
+ emit_move_insn (MEM_P (parmreg) ? copy_rtx (parmreg) : parmreg,
+ tempreg);
all->first_conversion_insn = get_insns ();
all->last_conversion_insn = get_last_insn ();
end_sequence ();
@@ -3331,7 +3334,7 @@ assign_parm_setup_reg (struct assign_parm_data_all *all, tree parm,
did_conversion = true;
}
else
- emit_move_insn (parmreg, rtl);
+ emit_move_insn (MEM_P (parmreg) ? copy_rtx (parmreg) : parmreg, rtl);
rtl = parmreg;