[gcc(refs/vendors/ARM/heads/arm-perf-staging)] Microblaze: Fixed missing save of r18 in fast_interrupt. Register 18 is used as a clobber register,
Tamar Christina
tnfchris@gcc.gnu.org
Fri Jul 17 14:23:39 GMT 2020
https://gcc.gnu.org/g:a2ccd78027197abb787762d27b63c1a73f82c1f5
commit a2ccd78027197abb787762d27b63c1a73f82c1f5
Author: Nagaraju Mekala <nmekala@xilinx.com>
Date: Sat Apr 4 14:40:08 2020 +0530
Microblaze: Fixed missing save of r18 in fast_interrupt. Register 18 is used as a clobber register, and must be stored when entering a fast_interrupt. Before this fix, register 18 was only saved if it was used directly in the interrupt function.
However, if the fast_interrupt function called a function that used
r18, the register would not be saved, and thus be mangled
upon returning from the interrupt.
* config/microblaze/microblaze.c (microblaze_must_save_register): Check
for fast_interrupt.
Diff:
---
gcc/ChangeLog | 8 ++++----
gcc/config/microblaze/microblaze.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 220255a3bc8..0ce457b7347 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,9 +1,9 @@
2020-04-05 Nagaraju Mekala <nmekala@xilix.com>
-
- * gcc/config/microblaze/microblaze.md (trap): Update output pattern.
- * gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
- (dg-final): update in the scan-assembler instruction
+ * config/microblaze/microblaze.c (microblaze_must_save_register): Check
+ for fast_interrupt.
+
+ * config/microblaze/microblaze.md (trap): Update output pattern.
2020-04-04 Hannes Domani <ssbssa@yahoo.de>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index b4754b12160..a0f81b71391 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -2035,7 +2035,7 @@ microblaze_must_save_register (int regno)
{
if (df_regs_ever_live_p (regno)
|| regno == MB_ABI_MSR_SAVE_REG
- || (interrupt_handler
+ || ((interrupt_handler || fast_interrupt)
&& (regno == MB_ABI_ASM_TEMP_REGNUM
|| regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM)))
return 1;
More information about the Gcc-cvs
mailing list