blob: 3786a71a08868ba67a9e51e8b1ab0d5eb44bdc14 [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001From fdb99f97b41f7cd06b81e668b88463d0fc2cbe87 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:54 -0700
4Subject: [PATCH] Fixing the issue with MicroBlaze builtin_alloc
5
6Fixing the issue with the builtin_alloc. Register r18 was not properly
7handling the stack pattern which was resolved by using free available
8register
9
10Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
11Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
12Upstream-Status: Pending
13---
14 gcc/config/microblaze/microblaze.md | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
16
17diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
18index 7a00629922..68c3b22bd4 100644
19--- a/gcc/config/microblaze/microblaze.md
20+++ b/gcc/config/microblaze/microblaze.md
21@@ -2076,10 +2076,10 @@
22 ""
23 {
24 rtx retaddr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
25- rtx rtmp = gen_rtx_REG (SImode, R_TMP);
26+ rtx reg = gen_reg_rtx (Pmode);
27 rtx neg_op0;
28
29- emit_move_insn (rtmp, retaddr);
30+ emit_move_insn (reg, retaddr);
31 if (GET_CODE (operands[1]) != CONST_INT)
32 {
33 neg_op0 = gen_reg_rtx (Pmode);
34@@ -2088,9 +2088,9 @@
35 neg_op0 = GEN_INT (- INTVAL (operands[1]));
36
37 emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
38- emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), rtmp);
39+ emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), reg);
40 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
41- emit_insn (gen_rtx_CLOBBER (SImode, rtmp));
42+ emit_insn (gen_rtx_CLOBBER (SImode, reg));
43 DONE;
44 }
45 )
46--
472.14.2
48