From: eager Date: Sun, 17 Feb 2013 16:18:09 +0000 (+0000) Subject: Free variable local allocs at block ends. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71cfadefb994de9249449fb7e71be012b6264a3f;p=thirdparty%2Fgcc.git Free variable local allocs at block ends. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1373e8bc9bf5..dbf8a1733281 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-02-17 Edgar E. Iglesias + + * config/microblaze/microblaze.md (save_stack_block): Define. + (restore_stack_block): Likewise. + 2013-02-16 Edgar E. Iglesias * config/microblaze/linux.h (TARGET_SUPPORTS_PIC): Define as 1. diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index 69df59220525..1d55a167be4d 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -1860,6 +1860,32 @@ } ) +(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"