]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Free variable local allocs at block ends.
authoreager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Feb 2013 16:18:09 +0000 (16:18 +0000)
committereager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Feb 2013 16:18:09 +0000 (16:18 +0000)
 * config/microblaze/microblaze.md (save_stack_block): Define.
   (restore_stack_block): Likewise.

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

gcc/ChangeLog
gcc/config/microblaze/microblaze.md

index 1373e8bc9bf55eb2c451418a464e8cdefda4f05b..dbf8a17332818f5149bfc25c76d2cba84f652e17 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-17  Edgar E. Iglesias  <edgar.iglesias@gmail.com>
+
+       * config/microblaze/microblaze.md (save_stack_block): Define.
+       (restore_stack_block): Likewise.
+
 2013-02-16  Edgar E. Iglesias  <edgar.iglesias@gmail.com>
 
        * config/microblaze/linux.h (TARGET_SUPPORTS_PIC): Define as 1.
index 69df59220525ee79677ddc1a292d56bbb813f532..1d55a167be4d216656519d685734553292a3d207 100644 (file)
   }
 )
 
+(define_expand "save_stack_block"
+  [(match_operand 0 "register_operand" "")
+   (match_operand 1 "register_operand" "")]
+  ""
+  {
+    emit_move_insn (operands[0], operands[1]);
+    DONE;
+  }
+)
+
+(define_expand "restore_stack_block"
+  [(match_operand 0 "register_operand" "")
+   (match_operand 1 "register_operand" "")]
+  ""
+  {
+    rtx retaddr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
+    rtx rtmp    = gen_rtx_REG (SImode, R_TMP);
+
+    /* Move the retaddr.  */
+    emit_move_insn (rtmp, retaddr);
+    emit_move_insn (operands[0], operands[1]);
+    emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), rtmp);
+    DONE;
+  }
+)
+
 ;; Trivial return.  Make it look like a normal return insn as that
 ;; allows jump optimizations to work better .
 (define_expand "return"