OSDN Git Service

* config/stormy16/stormy16.c (stormy16_expand_epilogue): Use
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Aug 2001 07:57:54 +0000 (07:57 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Aug 2001 07:57:54 +0000 (07:57 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45314 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 5286b9a..5c3b6bd 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 c29bc08..758b977 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 7310e6c..9a3b119 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