sibbling calls versus integreate.c
law@redhat.com
law@redhat.com
Wed Aug 8 13:56:00 GMT 2001
In message < 20010808182440.E30815@atrey.karlin.mff.cuni.cz >you write:
> Hi,
> this huge, but mechanical pass handles first part of problem with sibbling
> calls
> and optimizations.
>
> As I've sent previously to gcc-bugs, we do use VIRTUAL_INCOMMING_ARGS to st
> ore
> arguments in sibcall sequence. When integreate.c sees the code, it thinks,
> that the integreated function plays bad games with it's incomming arguments
> and allocates area on stack where it stores them.
>
> This is wrong, as we still want to access the incomming arugments of the
> function (not inlined one) to make sibcall sequence and works only because
> we never actually output the sibcall.
>
> This patch only avoids this bad converison. To get sibcalls out of inlined
> calls, we need to update considerably the sibcall.c, but I am not going to
> do that.
>
> I want to avoid bad effects of allocating the extra space on stack - this i
> ncludes
> for instance disabling of any other sibcalls in the function because of tes
> t:
>
> /* See if there are any reasons we can't perform either sibling or
> tail call optimizations. We must be careful with stack slots
> which are live at potential optimization sites. ??? The first
> test is overly conservative and should be replaced. */
> if (frame_offset
> /* Can't take address of local var if used by recursive call. */
> || current_function_uses_addressof
>
> Bootstrapped/regtested athlon.
Sorry. I'm not going to approve this because I still don't understand what
you're trying to do here.
If your goal is to avoid a using a sibcall when the sibcall's argument space
is smaller than the current function's argument space, then there are far
easier ways to do that.
Namely, extend the CALL_PLACEHOLDER to include the size of the argument
area. Then include a check in the code to commit to a sibcall which
prevents using the sibcall sequence if the current function's argument
list is not large enough.
jeff
More information about the Gcc-patches
mailing list