On 10/22/2010 10:09 AM, Josef Ahmad wrote: > I am wondering if there is a method to tell explicitly GCC (built > with target `sparc-elf') to generate a leaf procedure for a given > function. I had a look at the machine code generated by the > compiler, and it seems not to automatically generate a leaf > procedure for a function that has not calls, like: > > ---- > void foo(void) > { > return; > } > ---- I am surprised. I just looked in the gcc sources, and it seems to me that this optimization will always be applied if possible as long as we're optimizing. Maybe a SPARC maintainer can explain better. Andrew.