This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54602] [SH] Register pop insn not put in rts delay slot
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 13:48:04 +0000
- Subject: [Bug target/54602] [SH] Register pop insn not put in rts delay slot
- Auto-submitted: auto-generated
- References: <bug-54602-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54602
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-11 13:48:04 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> >
> > I don't know the history about it. I can only imagine that some
> > system could assume some banked regs will be not clobbered with
> > their exception handler and will be used like as normal registers.
> > A new -m option which controls the behavior of which default
> > is not to save/restore the banked regs?
>
> Oh well, why not ;)
> But first I'd like to think this through. I'll open a new PR for it later.
Turns out, there's already something there: 'nosave_low_regs' function
attribute, which is documented only in the source code:
sh.c (line ~9300):
nosave_low_regs - don't save r0..r7 in an interrupt handler.
This is useful on the SH3 and upwards,
which has a separate set of low regs for User and Supervisor modes.
This should only be used for the lowest level of interrupts. Higher
levels
of interrupts must save the registers in case they themselves are
interrupted.
I will improve the documentation regarding this.