public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Holsgrove <david.holsgrove@xilinx.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "Michael Eager (eager@eagercon.com)" <eager@eagercon.com>,
	John Williams	<jwilliams@xilinx.com>,
	"Edgar E. Iglesias (edgar.iglesias@gmail.com)"
	<edgar.iglesias@gmail.com>, Vinod Kathail <vinodk@xilinx.com>,
	Vidhumouli Hunsigida <vidhum@xilinx.com>,
	Nagaraju Mekala <nmekala@xilinx.com>, Tom Shui	<tshui@xilinx.com>
Subject: [Patch, microblaze]: Free variable local allocs at block ends
Date: Mon, 11 Feb 2013 06:38:00 -0000	[thread overview]
Message-ID: <30ab1be6-fc05-4cfa-b942-47aefc56a8c7@CO9EHSMHS013.ehs.local> (raw)

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

Free variable local allocs at block ends.

Changelog

2013-02-11  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

 * config/microblaze/microblaze.md (save_stack_block):
   Define.
   (restore_stack_block): Likewise.


[-- Attachment #2: 0003-gcc-microblaze-Free-variable-local-allocs-at-block-e.patch --]
[-- Type: application/octet-stream, Size: 1632 bytes --]

From 6c5916d3c79e65415070a75fe17662a49a9d6bf9 Mon Sep 17 00:00:00 2001
From: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Date: Sun, 21 Aug 2011 22:26:46 +0200
Subject: [PATCH] gcc-microblaze: Free variable local allocs at block ends.

Changelog

2013-02-11  Edgar E. Iglesias  <edgar.iglesias@gmail.com>

 * config/microblaze/microblaze.md (save_stack_block):
   Define.
   (restore_stack_block): Likewise.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
---
 gcc/config/microblaze/microblaze.md |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 69df592..1d55a16 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"
-- 
1.7.3.2


             reply	other threads:[~2013-02-11  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11  6:38 David Holsgrove [this message]
2013-02-17 16:18 ` Michael Eager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30ab1be6-fc05-4cfa-b942-47aefc56a8c7@CO9EHSMHS013.ehs.local \
    --to=david.holsgrove@xilinx.com \
    --cc=eager@eagercon.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwilliams@xilinx.com \
    --cc=nmekala@xilinx.com \
    --cc=tshui@xilinx.com \
    --cc=vidhum@xilinx.com \
    --cc=vinodk@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).