This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Sibcall on recursive functions
- From: "Paulo J. Matos" <pocmatos at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 14 Jan 2010 11:12:29 +0000
- Subject: Sibcall on recursive functions
Hi all,
I have the following function:
unsigned int fact_aux(unsigned int n, unsigned int k)
{
if(n == 0)
return k;
else
return fact_aux(n - 1, k * n);
}
unsigned int facti(unsigned int n)
{
return fact_aux(n, 1);
}
Gcc4.3.4 when I compile functions with : -Os -fno-inline-functions
-fno-inline-small-functions
calls TARGET_FUNCTION_OK_FOR_SIBCALL for the fact_aux call in facti,
but it does not call TARGET_FUNCTION_OK_FOR_SIBCALL for the fact_aux
recursive call, why?
--
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net