blob: 3b4b4c708e8276dff705e9f1921a801a477c6638 [file] [log] [blame]
Andrew Geissler84ad7c52020-06-27 00:00:16 -05001From 53ab5a3fec283aeb9d2efeb632d423b774192e65 Mon Sep 17 00:00:00 2001
Brad Bishop286d45c2018-10-02 15:21:57 -04002From: Mahesh Bodapati <mbodapat@xilinx.com>
Brad Bishop26bdd442019-08-16 17:08:17 -04003Date: Thu, 12 Jan 2017 17:50:03 +0530
Andrew Geissler84ad7c52020-06-27 00:00:16 -05004Subject: [PATCH 13/63] [Patch, microblaze]: Fixed missing save of r18 in
Brad Bishop26bdd442019-08-16 17:08:17 -04005 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 Bishop286d45c2018-10-02 15:21:57 -04008
9However, if the fast_interrupt function called a function that used
10r18, the register would not be saved, and thus be mangled
11upon returning from the interrupt.
12
13Changelog
14
152014-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
20Signed-off-by: Klaus Petersen <klauspetersen@gmail.com>
21Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
Brad Bishop286d45c2018-10-02 15:21:57 -040022---
23 gcc/config/microblaze/microblaze.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
Andrew Geissler84ad7c52020-06-27 00:00:16 -050027index ae45038..c834b49 100644
Brad Bishop286d45c2018-10-02 15:21:57 -040028--- a/gcc/config/microblaze/microblaze.c
29+++ b/gcc/config/microblaze/microblaze.c
Andrew Geissler84ad7c52020-06-27 00:00:16 -050030@@ -2043,7 +2043,7 @@ microblaze_must_save_register (int regno)
Brad Bishop286d45c2018-10-02 15:21:57 -040031 {
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 Bishop26bdd442019-08-16 17:08:17 -0400402.7.4
Brad Bishop286d45c2018-10-02 15:21:57 -040041