https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65374
Bug ID: 65374 Summary: [SH] Tail call optimization not done for libcalls Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: olegendo at gcc dot gnu.org Target: sh*-*-* This example function: unsigned int test (unsigned int x) { return __builtin_clz (x); } Compiled with -m4 -O2: _test: mov.l .L3,r0 sts.l pr,@-r15 jsr @r0 nop lds.l @r15+,pr rts nop .L4: .align 2 .L3: .long ___clzsi2 For some reason, tail call optimization is not performed in this case.