------- Comment #2 from carrot at google dot com 2009-05-01 06:21 ------- Actually gcc has already implemented this optimization, but it doesn't work for this case.
Reload pass tries to determine the stack frame, so it needs to check the push/pop lr optimization opportunity. One of the criteria is if there is any far jump inside the function. Unfortunately at this time gcc can't decide each instruction's length and basic block layout, so it can't know the offset of a jump. To be conservative it assumes every jump is a far jump. So any jump in a function will prevent this push/pop lr optimization. -- carrot at google dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carrot at google dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39989