https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34777
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |55212 --- Comment #12 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Oleg Endo from comment #11) > > seems to fix the test case of PR 34807. However, I've not tested it any > further and probably the fix is incomplete and works only for mem loads and > not stores. > In fact it can be broken again quite easily by inserting another insn that > requires R0 (tst #imm,r0 in this case): > > int glob, glob1; > > static int _dl_mmap (int xx) > { > register int __sc0 __asm__ ("r0") = glob1; > register int __sc1 __asm__ ("r1") = glob; > > if (xx & 3) > __asm__ ("trapa %1 " : "=z" (__sc0) : "i" (0x10), "0" (__sc0), "r" > (__sc1)); > > return (__sc0); > } > > void _start(int xx) > { > static int buf; > buf = _dl_mmap(xx); > } I've tried that test case with the sh-lra branch and the problems seem to be gone.