On Wed, Jan 6, 2010 at 10:50 AM, Paulo J. Matos <pocmatos@xxxxxxxxx> wrote: > Hi all, > > I am trying to implement sibcall optimization for a specific arch in > 4.3.4. However, this is only important for me to do if it maintains or > decreases code size. > I need to know the live registers, frame size, etc. Is this > information available at TARGET_FUNCTION_OK_FOR_SIBCALL or should this > hook be mainly used to decide to do sibcall based on analysis of the > tree? > > On the other hand I thought I could try to accept sibcall most of the > times through TARGET_FUNCTION_OK_FOR_SIBCALL and then on the expand of > sibcall_epilogue I would fallback to a normal leave if I decide that > sibcall is not worth it. Is this possible? > > If it is, how can I emit a 'normal leave' from sibcall_epilogue? > By reading the code for i386 it seems that the solution is to have a single function that expands the epilogue whose argument indicates if this should be a sibcall or not and depending on the argument perform the right actions. (corresponding to the ix_expand_epilogue of i386) :-) Thanks, -- Paulo Jorge Matos - pocmatos at gmail.com http://www.pmatos.net