blob: e75bebebd7fabf5a7b630ed107ce1b6892a3d61d [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001From 79ea36649467aea6045a49c7d016f8f9245efb8c Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:29 -0700
4Subject: [PATCH] MicroBlaze fixed missing save of r18 in fast_interrupt
5
6Fixed missing save of r18 in fast_interrupt. Register 18 is used as a
7clobber register, and must be stored when entering a fast_interrupt.
8Before this fix, register 18 was only saved if it was used directly in
9the interrupt function.
10
11However, if the fast_interrupt function called a function that used
12r18, the register would not be saved, and thus be mangled
13upon returning from the interrupt.
14
15Changelog
16
172014-02-27 Klaus Petersen <klauspetersen@gmail.com>
18
19 * gcc/config/microblaze/microblaze.c: Check for fast_interrupt in
20 microblaze_must_save_register.
21
22Signed-off-by: Klaus Petersen <klauspetersen@gmail.com>
23Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
24Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
25Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
26Upstream-Status: Pending
27---
28 gcc/config/microblaze/microblaze.c | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
32index 15080db539..558796cad9 100644
33--- a/gcc/config/microblaze/microblaze.c
34+++ b/gcc/config/microblaze/microblaze.c
35@@ -1943,7 +1943,7 @@ microblaze_must_save_register (int regno)
36 {
37 if (df_regs_ever_live_p (regno)
38 || regno == MB_ABI_MSR_SAVE_REG
39- || (interrupt_handler
40+ || ((interrupt_handler || fast_interrupt)
41 && (regno == MB_ABI_ASM_TEMP_REGNUM
42 || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM)))
43 return 1;
44--
452.14.2
46