From: Nick Clifton <nickc@redhat.com>
To: dj@redhat.com
Cc: gcc-patches@gcc.gnu.org
Subject: RFA: RL78: Always select register bank 0 at the start of an ISR
Date: Thu, 03 Jan 2013 12:49:00 -0000 [thread overview]
Message-ID: <878v8a1llw.fsf@redhat.com> (raw)
Hi DJ,
Since interrupts can happen at any time, it is possible for a ISR to
be called when register bank 0 is not the currently selected bank.
Hence the prologue for an interrupt handler should always select bank
0 before saving any registers. The patch below makes sure that this
happens.
No regressions with a rl78-elf toolchain.
OK to apply ?
Cheers
Nick
gcc/ChangeLog
2013-01-03 Nick Clifton <nickc@redhat.com>
* config/rl78/rl78.c (rl78_expand_prologue): Always select
register bank 0 at the start of an interrupt handler.
Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c (revision 194833)
+++ gcc/config/rl78/rl78.c (working copy)
@@ -839,6 +839,9 @@
if (flag_stack_usage_info)
current_function_static_stack_size = cfun->machine->framesize;
+ if (is_interrupt_func (cfun->decl))
+ emit_insn (gen_sel_rb (GEN_INT (0)));
+
for (i = 0; i < 16; i++)
if (cfun->machine->need_to_push [i])
{
next reply other threads:[~2013-01-03 12:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-03 12:49 Nick Clifton [this message]
2013-01-07 19:54 ` DJ Delorie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878v8a1llw.fsf@redhat.com \
--to=nickc@redhat.com \
--cc=dj@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).