Commit 6a62ca52 by DJ Delorie Committed by DJ Delorie

sh.c (sh_expand_epilogue): Fix interrupt handler register popping order.

* config/sh/sh.c (sh_expand_epilogue): Fix interrupt handler
register popping order.

From-SVN: r155742
parent c59449fa
2010-01-08 DJ Delorie <dj@redhat.com>
* config/sh/sh.c (sh_expand_epilogue): Fix interrupt handler
register popping order.
2010-01-08 Richard Guenther <rguenther@suse.de> 2010-01-08 Richard Guenther <rguenther@suse.de>
PR lto/42528 PR lto/42528
......
...@@ -7254,13 +7254,13 @@ sh_expand_epilogue (bool sibcall_p) ...@@ -7254,13 +7254,13 @@ sh_expand_epilogue (bool sibcall_p)
pop (PR_REG); pop (PR_REG);
} }
/* Banked registers are poped first to avoid being scheduled in the /* Banked registers are popped first to avoid being scheduled in the
delay slot. RTE switches banks before the ds instruction. */ delay slot. RTE switches banks before the ds instruction. */
if (current_function_interrupt) if (current_function_interrupt)
{ {
for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++) for (i = LAST_BANKED_REG; i >= FIRST_BANKED_REG; i--)
if (TEST_HARD_REG_BIT (live_regs_mask, i)) if (TEST_HARD_REG_BIT (live_regs_mask, i))
pop (LAST_BANKED_REG - i); pop (i);
last_reg = FIRST_PSEUDO_REGISTER - LAST_BANKED_REG - 1; last_reg = FIRST_PSEUDO_REGISTER - LAST_BANKED_REG - 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment