[Bug target/53689] [SH] GCC emits an invalid slot instruction for RTE (Return from Exception)

chrbr at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 11 13:21:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53689

--- Comment #4 from chrbr at gcc dot gnu.org 2012-07-11 13:21:22 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > (In reply to comment #0)
> > > > Under target (sh-elf) big-endian SuperH-2 (SH7604) (options -m2 -mb
> > 
> > > I've checked this case with SVN rev 189268 (GCC 4.8) and this problem is not
> > > present.
> > 
> > are you sure ? 
> > 
> > using sh-superh-elf-gcc -O2 a.c -S -fno-omit-frame-pointer
> > 
> > I also see the frame pointer restored from the delay slot. Is it only a -m2
> > problem ?
> 
> I'm not sure how sh-superh-elf-gcc is configured.  Does it use -m4 as default?
> If so, on SH4 it should be OK to do so, because the RTE instruction does only
> SSR -> SR, SPC -> PC and does not access or modify r15 / @r15.

You are right, the sequence is valid for sh4, but not for sh2. I didn't check
with -m2 so your checking was correct.



More information about the Gcc-bugs mailing list