This code: int g(int); int f(int x) { return g(x); } is correctly compiled to just f: b g But, if g is a function pointer: int (*g)(int); int f(int x) { return g(x); } then the generated code becomes much less efficient: f: str lr, [sp, #-4]! ldr r3, .L3 mov lr, pc ldr pc, [r3, #0] ldr pc, [sp], #4
Since tail call is now down at the tree level (except for expansion which is where the problem is), this is a target bug.
Mine.
Patch submitted here. http://gcc.gnu.org/ml/gcc-patches/2009-06/msg00373.html
Patch of comment #3 from Ramana was never committed to the trunk.
Ping Ramana.
> > --- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2011-09-09 14:55:20 UTC --- > Ping Ramana. Sigh - yes will look into this . Ramana > > -- > Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email > ------- You are receiving this mail because: ------- > You are the assignee for the bug. >
The patch as applied today causes some bootstrap failures and I'm investigating that. Ramana
http://gcc.gnu.org/ml/gcc-cvs/2013-05/msg00449.html Fixed on trunk. Ramana