Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 1 | From 4e4409f10b450ec9254e69445ffeb8d116906d16 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
| 3 | Date: Thu, 12 Jan 2017 16:50:17 +0530 |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 4 | Subject: [PATCH 11/63] [Patch, microblaze]: Fix the Microblaze crash with |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 5 | msmall-divides flag Compiler is crashing when we use msmall-divides and |
| 6 | mxl-barrel-shift flag. This is because when use above flags |
| 7 | microblaze_expand_divide function will be called for division operation. In |
| 8 | microblaze_expand_divide function we are using sub_reg but MicroBlaze doesn't |
| 9 | have subreg register due to this compiler was crashing. Changed the logic to |
| 10 | avoid sub_reg call |
| 11 | |
| 12 | Signed-off-by:Nagaraju Mekala <nmekala@xilix.com> |
| 13 | --- |
| 14 | gcc/config/microblaze/microblaze.c | 3 +-- |
| 15 | 1 file changed, 1 insertion(+), 2 deletions(-) |
| 16 | |
| 17 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 18 | index 55c1bec..ae45038 100644 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 19 | --- a/gcc/config/microblaze/microblaze.c |
| 20 | +++ b/gcc/config/microblaze/microblaze.c |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame^] | 21 | @@ -3715,8 +3715,7 @@ microblaze_expand_divide (rtx operands[]) |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 22 | mem_rtx = gen_rtx_MEM (QImode, |
| 23 | gen_rtx_PLUS (Pmode, regt1, div_table_rtx)); |
| 24 | |
| 25 | - insn = emit_insn (gen_movqi (regqi, mem_rtx)); |
| 26 | - insn = emit_insn (gen_movsi (operands[0], gen_rtx_SUBREG (SImode, regqi, 0))); |
| 27 | + insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx)); |
| 28 | jump = emit_jump_insn_after (gen_jump (div_end_label), insn); |
| 29 | JUMP_LABEL (jump) = div_end_label; |
| 30 | LABEL_NUSES (div_end_label) = 1; |
| 31 | -- |
| 32 | 2.7.4 |
| 33 | |