diff options
author | walt <walt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-07 17:58:52 +0000 |
---|---|---|
committer | walt <walt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-07 17:58:52 +0000 |
commit | c6cfe48feb80ec3f79a8e4e975581b8a8fdbbb89 (patch) | |
tree | 1f246a231a409cfe684156447a6b6c50bd088cf0 /gcc/config/tilepro | |
parent | 4e2b92f68fced845b12815c3e1390ab60f5acd9a (diff) | |
download | gcc-c6cfe48feb80ec3f79a8e4e975581b8a8fdbbb89.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185070 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/tilepro')
-rw-r--r-- | gcc/config/tilepro/tilepro.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c index 71b5807c5de..011ac083add 100644 --- a/gcc/config/tilepro/tilepro.c +++ b/gcc/config/tilepro/tilepro.c @@ -3556,9 +3556,8 @@ tilepro_expand_prologue (void) { /* Copy the old stack pointer aside so we can save it later. */ sp_copy_regno = next_scratch_regno--; - insn = FRP (emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno), - stack_pointer_rtx)); - add_reg_note (insn, REG_CFA_REGISTER, NULL_RTX); + emit_move_insn (gen_rtx_REG (Pmode, sp_copy_regno), + stack_pointer_rtx); } if (tilepro_current_function_is_leaf ()) @@ -3600,8 +3599,8 @@ tilepro_expand_prologue (void) } /* Save our frame pointer for backtrace chaining. */ - FRP (frame_emit_store (sp_copy_regno, STACK_POINTER_REGNUM, - chain_addr, cfa, cfa_offset)); + emit_insn (gen_movsi (gen_frame_mem (SImode, chain_addr), + gen_rtx_REG (SImode, sp_copy_regno))); } /* Compute where to start storing registers we need to save. */ @@ -3742,16 +3741,7 @@ tilepro_expand_epilogue (bool sibcall_p) emit_insn (gen_blockage ()); - if (crtl->calls_eh_return) - { - 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) + if (frame_pointer_needed) { /* Restore the old stack pointer by copying from the frame pointer. */ @@ -3767,6 +3757,10 @@ tilepro_expand_epilogue (bool sibcall_p) 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. */ if (frame_pointer_needed) { |