Re: Sibcall on recursive functions

2010-01-15 Thread Paulo J. Matos
gt;> Cc: gcc@gcc.gnu.org >> Subject: Re: Sibcall on recursive functions >> >> >> Because it is not really sibcalled but rather turned into a loop >> via >> tail recursion.  This is almost always profitable and never changes >> how many times the stack gets r

RE: Sibcall on recursive functions

2010-01-15 Thread Paulo De Oliveira Cantante De Matos
> -Original Message- > From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On > Behalf Of Andrew Pinski > Sent: 14 January 2010 17:08 > To: Paulo J. Matos > Cc: gcc@gcc.gnu.org > Subject: Re: Sibcall on recursive functions > > > Because it is n

Re: Sibcall on recursive functions

2010-01-14 Thread Andrew Pinski
On Thu, Jan 14, 2010 at 3:12 AM, Paulo J. Matos wrote: > 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 >

Sibcall on recursive functions

2010-01-14 Thread Paulo J. Matos
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-i