mirror of git://gcc.gnu.org/git/gcc.git
Fix an unwinding bug for functions with dynamic stack frames.
* config/tilegx/tilegx.c (tilegx_expand_prologue): Don't generate REG_CFA_* notes for the stack pointer. (tilegx_expand_epilogue): Restore stack pointer by adjusting it by EH_RETURN_STACKADJ_RTX. * config/tilepro/tilepro.c (tilepro_expand_prologue): Don't generate REG_CFA_* notes for the stack pointer. (tilepro_expand_epilogue): Restore stack pointer by adjusting it by EH_RETURN_STACKADJ_RTX. From-SVN: r185070
This commit is contained in:
parent
5869104b39
commit
95f2389a7d
|
@ -1,3 +1,14 @@
|
||||||
|
2012-03-07 Walter Lee <walt@tilera.com>
|
||||||
|
|
||||||
|
* config/tilegx/tilegx.c (tilegx_expand_prologue): Don't generate
|
||||||
|
REG_CFA_* notes for the stack pointer.
|
||||||
|
(tilegx_expand_epilogue): Restore stack pointer by adjusting it by
|
||||||
|
EH_RETURN_STACKADJ_RTX.
|
||||||
|
* config/tilepro/tilepro.c (tilepro_expand_prologue): Don't
|
||||||
|
generate REG_CFA_* notes for the stack pointer.
|
||||||
|
(tilepro_expand_epilogue): Restore stack pointer by adjusting it
|
||||||
|
by EH_RETURN_STACKADJ_RTX.
|
||||||
|
|
||||||
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
|
2012-03-07 Georg-Johann Lay <avr@gjlay.de>
|
||||||
|
|
||||||
* doc/invoke.texi (AVR Built-in Macros): Correct condition for
|
* doc/invoke.texi (AVR Built-in Macros): Correct condition for
|
||||||
|
|
|
@ -3881,9 +3881,8 @@ tilegx_expand_prologue (void)
|
||||||
{
|
{
|
||||||
/* Copy the old stack pointer aside so we can save it later. */
|
/* Copy the old stack pointer aside so we can save it later. */
|
||||||
sp_copy_regno = next_scratch_regno--;
|
sp_copy_regno = next_scratch_regno--;
|
||||||
insn = FRP (emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno),
|
emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno),
|
||||||
stack_pointer_rtx));
|
stack_pointer_rtx);
|
||||||
add_reg_note (insn, REG_CFA_REGISTER, NULL_RTX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tilegx_current_function_is_leaf ())
|
if (tilegx_current_function_is_leaf ())
|
||||||
|
@ -3925,8 +3924,8 @@ tilegx_expand_prologue (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save our frame pointer for backtrace chaining. */
|
/* Save our frame pointer for backtrace chaining. */
|
||||||
FRP (frame_emit_store (sp_copy_regno, STACK_POINTER_REGNUM,
|
emit_insn (gen_movdi (gen_frame_mem (DImode, chain_addr),
|
||||||
chain_addr, cfa, cfa_offset));
|
gen_rtx_REG (DImode, sp_copy_regno)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute where to start storing registers we need to save. */
|
/* Compute where to start storing registers we need to save. */
|
||||||
|
@ -4067,16 +4066,7 @@ tilegx_expand_epilogue (bool sibcall_p)
|
||||||
|
|
||||||
emit_insn (gen_blockage ());
|
emit_insn (gen_blockage ());
|
||||||
|
|
||||||
if (crtl->calls_eh_return)
|
if (frame_pointer_needed)
|
||||||
{
|
|
||||||
rtx r = compute_frame_addr (-total_size + UNITS_PER_WORD,
|
|
||||||
&next_scratch_regno);
|
|
||||||
insn = emit_move_insn (gen_lowpart (DImode, stack_pointer_rtx),
|
|
||||||
gen_frame_mem (DImode, r));
|
|
||||||
RTX_FRAME_RELATED_P (insn) = 1;
|
|
||||||
REG_NOTES (insn) = cfa_restores;
|
|
||||||
}
|
|
||||||
else if (frame_pointer_needed)
|
|
||||||
{
|
{
|
||||||
/* Restore the old stack pointer by copying from the frame
|
/* Restore the old stack pointer by copying from the frame
|
||||||
pointer. */
|
pointer. */
|
||||||
|
@ -4100,6 +4090,16 @@ tilegx_expand_epilogue (bool sibcall_p)
|
||||||
cfa_restores);
|
cfa_restores);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crtl->calls_eh_return)
|
||||||
|
{
|
||||||
|
if (TARGET_32BIT)
|
||||||
|
emit_insn (gen_sp_adjust_32bit (stack_pointer_rtx, stack_pointer_rtx,
|
||||||
|
EH_RETURN_STACKADJ_RTX));
|
||||||
|
else
|
||||||
|
emit_insn (gen_sp_adjust (stack_pointer_rtx, stack_pointer_rtx,
|
||||||
|
EH_RETURN_STACKADJ_RTX));
|
||||||
|
}
|
||||||
|
|
||||||
/* Restore the old frame pointer. */
|
/* Restore the old frame pointer. */
|
||||||
if (frame_pointer_needed)
|
if (frame_pointer_needed)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3556,9 +3556,8 @@ tilepro_expand_prologue (void)
|
||||||
{
|
{
|
||||||
/* Copy the old stack pointer aside so we can save it later. */
|
/* Copy the old stack pointer aside so we can save it later. */
|
||||||
sp_copy_regno = next_scratch_regno--;
|
sp_copy_regno = next_scratch_regno--;
|
||||||
insn = FRP (emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno),
|
emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno),
|
||||||
stack_pointer_rtx));
|
stack_pointer_rtx);
|
||||||
add_reg_note (insn, REG_CFA_REGISTER, NULL_RTX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tilepro_current_function_is_leaf ())
|
if (tilepro_current_function_is_leaf ())
|
||||||
|
@ -3600,8 +3599,8 @@ tilepro_expand_prologue (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save our frame pointer for backtrace chaining. */
|
/* Save our frame pointer for backtrace chaining. */
|
||||||
FRP (frame_emit_store (sp_copy_regno, STACK_POINTER_REGNUM,
|
emit_insn (gen_movsi (gen_frame_mem (SImode, chain_addr),
|
||||||
chain_addr, cfa, cfa_offset));
|
gen_rtx_REG (SImode, sp_copy_regno)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute where to start storing registers we need to save. */
|
/* Compute where to start storing registers we need to save. */
|
||||||
|
@ -3742,16 +3741,7 @@ tilepro_expand_epilogue (bool sibcall_p)
|
||||||
|
|
||||||
emit_insn (gen_blockage ());
|
emit_insn (gen_blockage ());
|
||||||
|
|
||||||
if (crtl->calls_eh_return)
|
if (frame_pointer_needed)
|
||||||
{
|
|
||||||
rtx r = compute_frame_addr (-total_size + UNITS_PER_WORD,
|
|
||||||
&next_scratch_regno);
|
|
||||||
insn = emit_move_insn (gen_rtx_REG (Pmode, STACK_POINTER_REGNUM),
|
|
||||||
gen_frame_mem (Pmode, r));
|
|
||||||
RTX_FRAME_RELATED_P (insn) = 1;
|
|
||||||
REG_NOTES (insn) = cfa_restores;
|
|
||||||
}
|
|
||||||
else if (frame_pointer_needed)
|
|
||||||
{
|
{
|
||||||
/* Restore the old stack pointer by copying from the frame
|
/* Restore the old stack pointer by copying from the frame
|
||||||
pointer. */
|
pointer. */
|
||||||
|
@ -3767,6 +3757,10 @@ tilepro_expand_epilogue (bool sibcall_p)
|
||||||
cfa_restores);
|
cfa_restores);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crtl->calls_eh_return)
|
||||||
|
emit_insn (gen_sp_adjust (stack_pointer_rtx, stack_pointer_rtx,
|
||||||
|
EH_RETURN_STACKADJ_RTX));
|
||||||
|
|
||||||
/* Restore the old frame pointer. */
|
/* Restore the old frame pointer. */
|
||||||
if (frame_pointer_needed)
|
if (frame_pointer_needed)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue