Hi,

In TARGET_FUNCTION_OK_FOR_SIBCALL I use the number of callees of the current_function_decl to decide if a sibcall should be done.

I have:
int aaa[9];

__attribute__ ((noinline))
int *foo(void) { return aaa; }

__attribute__ ((noinline))
void bar(int *a) { a[0] = 0x1234; }

void test(void)
{
    int *x;
    x = foo();
    x[8] = 1;
    bar(x);
}


I then use this code in TARGET_FUNCTION_OK_FOR_SIBCALL:

    node = cgraph_get_node(current_function_decl);
    if(node == NULL)
        return false;

    for(edge = node->callees; edge; edge = edge->next_callee)
        if(++ncallees > 1)
            return false;

    return true;

In GCC4.4 function test presents 2 callees foo() and bar() and the sibcall is not done. In GCC4.5 the sibcall is done (but shouldn't) because callees in cgraph is 0x0. I wonder if this information is not available anymore at this point and if there's something I can do about it.

Cheers,
--
Paulo Matos

Reply via email to