aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@redhat.com>2001-08-31 07:57:54 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2001-08-31 07:57:54 +0000
commite2470e1be7112ed39d7f6ec0bb5c91fc54d02264 (patch)
tree24b2c46fc2b1ed7d372a5b59e977b01466ef88d7
parent06d2bb80020a3b32c913b41d2b52281d2a1aa048 (diff)
downloadgcc-e2470e1be7112ed39d7f6ec0bb5c91fc54d02264.zip
gcc-e2470e1be7112ed39d7f6ec0bb5c91fc54d02264.tar.gz
gcc-e2470e1be7112ed39d7f6ec0bb5c91fc54d02264.tar.bz2
stormy16.c (stormy16_expand_epilogue): Use the frame pointer to pop the stack if convenient.
* config/stormy16/stormy16.c (stormy16_expand_epilogue): Use the frame pointer to pop the stack if convenient. * config/stormy16/stormy16.c (stormy16_initialize_trampoline): Don't use post-increment before combine. * config/stormy16/stormy16.h (STATIC_CHAIN_REGNUM): Don't use a call-saved register. From-SVN: r45314
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/stormy16/stormy16.c14
-rw-r--r--gcc/config/stormy16/stormy16.h2
3 files changed, 22 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5286b9a..5c3b6bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2001-08-31 Geoffrey Keating <geoffk@redhat.com>
+
+ * config/stormy16/stormy16.c (stormy16_expand_epilogue): Use
+ the frame pointer to pop the stack if convenient.
+
+ * config/stormy16/stormy16.c (stormy16_initialize_trampoline):
+ Don't use post-increment before combine.
+ * config/stormy16/stormy16.h (STATIC_CHAIN_REGNUM): Don't use
+ a call-saved register.
+
2001-08-31 Andreas Jaeger <aj@suse.de>
* jump.c (mark_jump_label): Revert patch from 2001-08-28, the
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index c29bc08..758b977 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1023,8 +1023,13 @@ stormy16_expand_epilogue ()
/* Pop the stack for the locals. */
if (layout.locals_size)
- emit_addhi3_postreload (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (- layout.locals_size));
+ {
+ if (frame_pointer_needed && layout.sp_minus_fp == layout.locals_size)
+ emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
+ else
+ emit_addhi3_postreload (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- layout.locals_size));
+ }
/* Restore any call-saved registers. */
for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--)
@@ -1262,18 +1267,21 @@ stormy16_initialize_trampoline (addr, fnaddr, static_chain)
rtx reg_fnaddr = gen_reg_rtx (HImode);
rtx reg_addr_mem;
- reg_addr_mem = gen_rtx_MEM (HImode, gen_rtx_POST_INC (Pmode, reg_addr));
+ reg_addr_mem = gen_rtx_MEM (HImode, reg_addr);
emit_move_insn (reg_addr, addr);
emit_move_insn (temp, GEN_INT (0x3130 | STATIC_CHAIN_REGNUM));
emit_move_insn (reg_addr_mem, temp);
+ emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
emit_move_insn (temp, static_chain);
emit_move_insn (reg_addr_mem, temp);
+ emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
emit_move_insn (reg_fnaddr, fnaddr);
emit_move_insn (temp, reg_fnaddr);
emit_insn (gen_andhi3 (temp, temp, GEN_INT (0xFF)));
emit_insn (gen_iorhi3 (temp, temp, GEN_INT (0x0200)));
emit_move_insn (reg_addr_mem, temp);
+ emit_insn (gen_addhi3 (reg_addr, reg_addr, const2_rtx));
emit_insn (gen_lshrhi3 (reg_fnaddr, reg_fnaddr, GEN_INT (8)));
emit_move_insn (reg_addr_mem, reg_fnaddr);
}
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 7310e6c..9a3b119 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1785,7 +1785,7 @@ enum reg_class
If the static chain is passed in memory, these macros should not be defined;
instead, the next two macros should be defined. */
-#define STATIC_CHAIN_REGNUM 12
+#define STATIC_CHAIN_REGNUM 1
/* #define STATIC_CHAIN_INCOMING_REGNUM */
/* If the static chain is passed in memory, these macros provide rtx giving