Posted on:
Has anyone had success with __attribute__((flatten)) using yagarto? I have tried various locations of the attribute tag in the function declaration or definition, but it appears the attribute is completely ignored.
void test_flatten(void) __attribute__((flatten)); void test_flatten(void){ function1(); function2(); } |
From what I understand, flatten is supposed to "inline" all calls within a function, essentially creating one large "stand-alone" function. When I step through the supposedly flattened code, there are still "bl" instructions to function1() and function2() locations.
Posted on:
I should add that the docs say "The flatten attribute only works reliably in unit-at-a-time mode. ", which should be enabled with optimization -O1. But I still get don't get the single monolithic block of code I expect, there are still branches to the other functions.
Posted on:
> From what I understand, flatten is supposed to "inline" all calls within > a function ... "if possible". Did you define those two functions in the same implementation file as your test_flatten function? If they are implemented in a different one, they can't be inlined.