blob: 6af0f10e2b19e5528b0a7a357d866701e1a0915c [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From ed23e22fb25a2d3dc357c0743f51b2735fc46a6a 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
4Subject: [PATCH 13/54] [Patch, microblaze]: Fixed missing save of r18 in
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 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
Brad Bishop26bdd442019-08-16 17:08:17 -040027index cbe8cb7..6f0b4f4 100644
Brad Bishop286d45c2018-10-02 15:21:57 -040028--- a/gcc/config/microblaze/microblaze.c
29+++ b/gcc/config/microblaze/microblaze.c
Brad Bishop26bdd442019-08-16 17:08:17 -040030@@ -1967,7 +1967,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