diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2003-03-31 22:28:40 +0200 |
---|---|---|
committer | Stephane Carrez <ciceron@gcc.gnu.org> | 2003-03-31 22:28:40 +0200 |
commit | 07faf2d6cd7cc39b86bd8be098ad85dbfb67d565 (patch) | |
tree | 06ec6b8c8cc9c7c03b4dd72db5c7b90b77f2f6d0 | |
parent | adff28c38d207dc3a6007b81380407de0b3def57 (diff) | |
download | gcc-07faf2d6cd7cc39b86bd8be098ad85dbfb67d565.zip gcc-07faf2d6cd7cc39b86bd8be098ad85dbfb67d565.tar.gz gcc-07faf2d6cd7cc39b86bd8be098ad85dbfb67d565.tar.bz2 |
m68hc11.c (expand_prologue): For an interrupt handler save the soft registers after the frame pointer so...
* config/m68hc11/m68hc11.c (expand_prologue): For an interrupt handler
save the soft registers after the frame pointer so that gdb can unwind
the frame more easily.
(expand_epilogue): Likewise in opposite order; allow to use X register
as scratch if the return value is by reference.
From-SVN: r65104
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.c | 18 |
2 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 545b048..57283ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-03-31 Stephane Carrez <stcarrez@nerim.fr> + + * config/m68hc11/m68hc11.c (expand_prologue): For an interrupt handler + save the soft registers after the frame pointer so that gdb can unwind + the frame more easily. + (expand_epilogue): Likewise in opposite order; allow to use X register + as scratch if the return value is by reference. + 2003-03-31 Jason Merrill <jason@redhat.com> PR java/10145 diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 97d43d3..0e8f364 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -1683,6 +1683,10 @@ expand_prologue () else scratch = ix_reg; + /* Save current stack frame. */ + if (frame_pointer_needed) + emit_move_after_reload (stack_push_word, hard_frame_pointer_rtx, scratch); + /* For an interrupt handler, we must preserve _.tmp, _.z and _.xy. Other soft registers in page0 need not to be saved because they will be restored by C functions. For a trap handler, we don't @@ -1697,10 +1701,6 @@ expand_prologue () scratch); } - /* Save current stack frame. */ - if (frame_pointer_needed) - emit_move_after_reload (stack_push_word, hard_frame_pointer_rtx, scratch); - /* Allocate local variables. */ if (TARGET_M6812 && (size > 4 || size == 3)) { @@ -1774,7 +1774,7 @@ expand_epilogue () else return_size = GET_MODE_SIZE (GET_MODE (current_function_return_rtx)); - if (return_size > HARD_REG_SIZE) + if (return_size > HARD_REG_SIZE && return_size <= 2 * HARD_REG_SIZE) scratch = iy_reg; else scratch = ix_reg; @@ -1821,10 +1821,6 @@ expand_epilogue () stack_pointer_rtx, GEN_INT (1))); } - /* Restore previous frame pointer. */ - if (frame_pointer_needed) - emit_move_after_reload (hard_frame_pointer_rtx, stack_pop_word, scratch); - /* For an interrupt handler, restore ZTMP, ZREG and XYREG. */ if (current_function_interrupt) { @@ -1835,6 +1831,10 @@ expand_epilogue () emit_move_after_reload (m68hc11_soft_tmp_reg, stack_pop_word, scratch); } + /* Restore previous frame pointer. */ + if (frame_pointer_needed) + emit_move_after_reload (hard_frame_pointer_rtx, stack_pop_word, scratch); + /* If the trap handler returns some value, copy the value in D, X onto the stack so that the rti will pop the return value correctly. */ |