blob: 3786a71a08868ba67a9e51e8b1ab0d5eb44bdc14 [file] [log] [blame]
From fdb99f97b41f7cd06b81e668b88463d0fc2cbe87 Mon Sep 17 00:00:00 2001
From: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
Date: Sat, 26 Aug 2017 19:21:54 -0700
Subject: [PATCH] Fixing the issue with MicroBlaze builtin_alloc
Fixing the issue with the builtin_alloc. Register r18 was not properly
handling the stack pattern which was resolved by using free available
register
Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Upstream-Status: Pending
---
gcc/config/microblaze/microblaze.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 7a00629922..68c3b22bd4 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -2076,10 +2076,10 @@
""
{
rtx retaddr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
- rtx rtmp = gen_rtx_REG (SImode, R_TMP);
+ rtx reg = gen_reg_rtx (Pmode);
rtx neg_op0;
- emit_move_insn (rtmp, retaddr);
+ emit_move_insn (reg, retaddr);
if (GET_CODE (operands[1]) != CONST_INT)
{
neg_op0 = gen_reg_rtx (Pmode);
@@ -2088,9 +2088,9 @@
neg_op0 = GEN_INT (- INTVAL (operands[1]));
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
- emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), rtmp);
+ emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), reg);
emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
- emit_insn (gen_rtx_CLOBBER (SImode, rtmp));
+ emit_insn (gen_rtx_CLOBBER (SImode, reg));
DONE;
}
)
--
2.14.2