Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 1 | From 53ab5a3fec283aeb9d2efeb632d423b774192e65 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 3 | Date: Thu, 12 Jan 2017 17:50:03 +0530 |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 4 | Subject: [PATCH 13/63] [Patch, microblaze]: Fixed missing save of r18 in |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 5 | fast_interrupt. Register 18 is used as a clobber register, and must be stored |
| 6 | when entering a fast_interrupt. Before this fix, register 18 was only saved |
| 7 | if it was used directly in the interrupt function. |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 8 | |
| 9 | However, if the fast_interrupt function called a function that used |
| 10 | r18, the register would not be saved, and thus be mangled |
| 11 | upon returning from the interrupt. |
| 12 | |
| 13 | Changelog |
| 14 | |
| 15 | 2014-02-27 Klaus Petersen <klauspetersen@gmail.com> |
| 16 | |
| 17 | * gcc/config/microblaze/microblaze.c: Check for fast_interrupt in |
| 18 | microblaze_must_save_register. |
| 19 | |
| 20 | Signed-off-by: Klaus Petersen <klauspetersen@gmail.com> |
| 21 | Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 22 | --- |
| 23 | gcc/config/microblaze/microblaze.c | 2 +- |
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 25 | |
| 26 | 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] | 27 | index ae45038..c834b49 100644 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 28 | --- a/gcc/config/microblaze/microblaze.c |
| 29 | +++ b/gcc/config/microblaze/microblaze.c |
Andrew Geissler | 84ad7c5 | 2020-06-27 00:00:16 -0500 | [diff] [blame] | 30 | @@ -2043,7 +2043,7 @@ microblaze_must_save_register (int regno) |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 31 | { |
| 32 | if (df_regs_ever_live_p (regno) |
| 33 | || regno == MB_ABI_MSR_SAVE_REG |
| 34 | - || (interrupt_handler |
| 35 | + || ((interrupt_handler || fast_interrupt) |
| 36 | && (regno == MB_ABI_ASM_TEMP_REGNUM |
| 37 | || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM))) |
| 38 | return 1; |
| 39 | -- |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 40 | 2.7.4 |
Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame] | 41 | |