From a2ccd78027197abb787762d27b63c1a73f82c1f5 Mon Sep 17 00:00:00 2001 From: Nagaraju Mekala Date: Sat, 4 Apr 2020 14:40:08 +0530 Subject: [PATCH] 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. --- 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 - - * 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 Jakub Jelinek 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; -- 2.30.2