This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Gcc 4.3.4 fails to call TARGET_FUNCTION_OK_FOR_SIBCALL
- From: "Paulo J. Matos" <pocmatos at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 7 Jan 2010 11:46:26 +0000
- Subject: Gcc 4.3.4 fails to call TARGET_FUNCTION_OK_FOR_SIBCALL
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
Why is TARGET_FUNCTION_OK_FOR_SIBCALL only called once in caller and
it is not being called for the callee call?
Cheers,
--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net