Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 1 | From 1a9dcdb578452ecd53e0aec65fe6279233218778 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
| 3 | Date: Sat, 26 Aug 2017 19:21:26 -0700 |
| 4 | Subject: [PATCH] Fix the Microblaze crash with msmall-divides flag |
| 5 | |
| 6 | Fix the Microblaze crash with msmall-divides flag Compiler is crashing |
| 7 | when we use msmall-divides and mxl-barrel-shift flag. This is because |
| 8 | when use above flags microblaze_expand_divide function will be called |
| 9 | for division operation. In microblaze_expand_divide function we are |
| 10 | using sub_reg but MicroBlaze doesn't have subreg register due to this |
| 11 | compiler was crashing. Changed the logic to avoid sub_reg call |
| 12 | |
| 13 | Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> |
| 14 | Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> |
| 15 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> |
| 16 | Upstream-Status: Pending |
| 17 | --- |
| 18 | gcc/config/microblaze/microblaze.c | 3 +-- |
| 19 | 1 file changed, 1 insertion(+), 2 deletions(-) |
| 20 | |
| 21 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c |
| 22 | index bba6983b65..15080db539 100644 |
| 23 | --- a/gcc/config/microblaze/microblaze.c |
| 24 | +++ b/gcc/config/microblaze/microblaze.c |
| 25 | @@ -3527,8 +3527,7 @@ microblaze_expand_divide (rtx operands[]) |
| 26 | mem_rtx = gen_rtx_MEM (QImode, |
| 27 | gen_rtx_PLUS (Pmode, regt1, div_table_rtx)); |
| 28 | |
| 29 | - insn = emit_insn (gen_movqi (regqi, mem_rtx)); |
| 30 | - insn = emit_insn (gen_movsi (operands[0], gen_rtx_SUBREG (SImode, regqi, 0))); |
| 31 | + insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx)); |
| 32 | jump = emit_jump_insn_after (gen_jump (div_end_label), insn); |
| 33 | JUMP_LABEL (jump) = div_end_label; |
| 34 | LABEL_NUSES (div_end_label) = 1; |
| 35 | -- |
| 36 | 2.14.2 |
| 37 | |