aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arc/arc.c
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2017-03-27 12:56:04 +0200
committerClaudiu Zissulescu <claziss@gcc.gnu.org>2017-03-27 12:56:04 +0200
commit84804c5b47636c7fa8bbbd1481ed426f2efc2654 (patch)
tree98fbcc94f6f8c9ff7f65db94999708007e2de327 /gcc/config/arc/arc.c
parentc5e5f5f6429b05b47110f8dea839ec055d69bb4f (diff)
downloadgcc-84804c5b47636c7fa8bbbd1481ed426f2efc2654.zip
gcc-84804c5b47636c7fa8bbbd1481ed426f2efc2654.tar.gz
gcc-84804c5b47636c7fa8bbbd1481ed426f2efc2654.tar.bz2
[ARC] Save/restore blink when in ISR.
gcc/ 2017-03-27 Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc.c (arc_epilogue_uses): BLINK should be also restored when in interrupt. * config/arc/arc.md (simple_return): ARCv2 rtie instruction doesn't have delay slot. 2017-03-27 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gcc.target/arc/interrupt-4.c: New file. From-SVN: r246495
Diffstat (limited to 'gcc/config/arc/arc.c')
-rw-r--r--gcc/config/arc/arc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 1116b2d..0563a74 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -9381,9 +9381,10 @@ arc_can_follow_jump (const rtx_insn *follower, const rtx_insn *followee)
Return true if REGNO should be added to the deemed uses of the epilogue.
We use the return address
- arc_return_address_regs[arc_compute_function_type (cfun)] .
- But also, we have to make sure all the register restore instructions
- are known to be live in interrupt functions. */
+ arc_return_address_regs[arc_compute_function_type (cfun)]. But
+ also, we have to make sure all the register restore instructions
+ are known to be live in interrupt functions, plus the blink
+ register if it is clobbered by the isr. */
bool
arc_epilogue_uses (int regno)
@@ -9396,7 +9397,8 @@ arc_epilogue_uses (int regno)
{
if (!fixed_regs[regno])
return true;
- return regno == arc_return_address_regs[cfun->machine->fn_type];
+ return ((regno == arc_return_address_regs[cfun->machine->fn_type])
+ || (regno == RETURN_ADDR_REGNUM));
}
else
return regno == RETURN_ADDR_REGNUM;