Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame^] | 1 | From fdb99f97b41f7cd06b81e668b88463d0fc2cbe87 Mon Sep 17 00:00:00 2001 |
| 2 | From: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 3 | Date: Sat, 26 Aug 2017 19:21:54 -0700 |
| 4 | Subject: [PATCH] Fixing the issue with MicroBlaze builtin_alloc |
| 5 | |
| 6 | Fixing the issue with the builtin_alloc. Register r18 was not properly |
| 7 | handling the stack pattern which was resolved by using free available |
| 8 | register |
| 9 | |
| 10 | Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 11 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> |
| 12 | Upstream-Status: Pending |
| 13 | --- |
| 14 | gcc/config/microblaze/microblaze.md | 8 ++++---- |
| 15 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 16 | |
| 17 | diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md |
| 18 | index 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 | -- |
| 47 | 2.14.2 |
| 48 | |