This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc 4.3.4 fails to call TARGET_FUNCTION_OK_FOR_SIBCALL
On Thu, Jan 7, 2010 at 11:46 AM, Paulo J. Matos <pocmatos@gmail.com> wrote:
> Hi all,
>
> With the code:
> -----------------------------
> extern void display(unsigned int);
>
> void callee(int z) Â// Sibcall worth it
> {
> Â Âdisplay(z);
> }
>
> void caller(int x, int y) // Sibcall not worth it
> {
> Â Âdisplay(x);
> Â Âdisplay(y);
> Â Âcallee(x*y);
> }
> -----------------------------
>
> I have put a few prints in TARGET_FUNCTION_OK_FOR_SIBCALL (when
> compiled with -Os):
> current pass = expand (135)
> Function ok: callee
> Â Â Â ÂCallee display
> Â Â Â Âframesize 0
> Â Â Â Âtotalsize 2
> Â Â Â Âcurrent_function_pretend_args_size 0
>
> current pass = expand (135)
> Function ok: caller
> Â Â Â ÂCallee display
> Â Â Â Âframesize 0
> Â Â Â Âtotalsize 0
> Â Â Â Âcurrent_function_pretend_args_size 0
>
This case is interesting because it seems that callee is being inlined
into caller. Still intriguing is that the same happens with: -Os
-fno-inline -fno-inline-small-functions
-fno-inline-functions-called-once
--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net