This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]