aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2010-01-08 14:02:28 -0500
committerDJ Delorie <dj@gcc.gnu.org>2010-01-08 14:02:28 -0500
commit6a62ca52285abbd6295a31a62bc1358e902979c9 (patch)
tree74bc0527507be321bff07dc113b191cb137921ff
parentc59449fa245b3ec2397a7020dab35deb876b9c5e (diff)
downloadgcc-6a62ca52285abbd6295a31a62bc1358e902979c9.zip
gcc-6a62ca52285abbd6295a31a62bc1358e902979c9.tar.gz
gcc-6a62ca52285abbd6295a31a62bc1358e902979c9.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4f7f36f..fdf4c85 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR lto/42528
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 5fe752e..aaa745d 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -7254,13 +7254,13 @@ sh_expand_epilogue (bool sibcall_p)
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. */
if (current_function_interrupt)
{
- for (i = FIRST_BANKED_REG; i <= LAST_BANKED_REG; i++)
- if (TEST_HARD_REG_BIT (live_regs_mask, i))
- pop (LAST_BANKED_REG - i);
+ for (i = LAST_BANKED_REG; i >= FIRST_BANKED_REG; i--)
+ if (TEST_HARD_REG_BIT (live_regs_mask, i))
+ pop (i);
last_reg = FIRST_PSEUDO_REGISTER - LAST_BANKED_REG - 1;
}