Microblaze: Fixed missing save of r18 in fast_interrupt. Register 18 is used as a...
authorNagaraju Mekala <nmekala@xilinx.com>
Sat, 4 Apr 2020 09:10:08 +0000 (14:40 +0530)
committerJeff Law <law@redhat.com>
Sun, 5 Apr 2020 16:13:37 +0000 (10:13 -0600)
    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
gcc/config/microblaze/microblaze.c

index 220255a3bc8ffeb47b8d1cd13de35c40274d86bd..0ce457b734752a1e4eb10e13a8fe7be0edbe0532 100644 (file)
@@ -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>
index b4754b121602654af06f14eeb158bc82e0b0b84a..a0f81b71391ef4711a1324a0461f43c8dd04f0bf 100644 (file)
@@ -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;