GCC and SPARC leaf procedures

Andrew Haley aph@redhat.com
Fri Oct 22 11:27:00 GMT 2010


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.



More information about the Gcc-help mailing list