]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stormy16.c (stormy16_expand_epilogue): Use the frame pointer to pop the stack if...
authorGeoffrey Keating <geoffk@redhat.com>
Fri, 31 Aug 2001 07:57:54 +0000 (07:57 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Fri, 31 Aug 2001 07:57:54 +0000 (07:57 +0000)
* 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

gcc/ChangeLog
gcc/config/stormy16/stormy16.c
gcc/config/stormy16/stormy16.h

index 5286b9af01ab7015d67f20e93b8ee6ed139ad758..5c3b6bd1cc4fe900a12c41952ff038d7c8b39d8a 100644 (file)
@@ -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
index c29bc085d954d8cf4706a7190c9a485a38869803..758b97770b6fc42cdb1f4ab74b0221ca0b5b8076 100644 (file)
@@ -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);
 }
index 7310e6cdc1beb3d9e0251c1fe9a10bb1d5597b67..9a3b1193084117750f3afb55bf7dd06d511697d3 100644 (file)
@@ -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