public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/ieee)] Microblaze: Fixed missing save of r18 in fast_interrupt. Register 18 is used as a clobber register,
@ 2020-04-16 22:54 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2020-04-16 22:54 UTC (permalink / raw)
  To: gcc-cvs

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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-16 22:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 22:54 [gcc(refs/users/meissner/heads/ieee)] Microblaze: Fixed missing save of r18 in fast_interrupt. Register 18 is used as a clobber register, Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).