-foptimize-sibling-calls and passing structs

Mike Stump mrs@windriver.com
Mon Jun 5 16:26:00 GMT 2000


> Date: Sun, 4 Jun 2000 17:58:47 +0200
> From: Jamie Lokier <egcs@tantalophile.demon.co.uk>
> To: Artur Skawina <skawina@geocities.com>

> Artur Skawina wrote:
> > r() gets compiled to:
> > 
> >   <r>:
> > 	sub    $0xc,%esp
> > 	lea    0x10(%esp,1),%eax
> > 	mov    %eax,0x10(%esp,1)
> > 	add    $0xc,%esp
> > 	jmp    <p>
> > 
> > which does seem to be a bit aggressive...

> I assume you mean not aggressive enough.  It should be

>     lea    4(%esp,1),%eax
>     mov    %eax,4(%esp,1)
>     jmp    <p>

We can get this code, if we expose the stack to the normal
optimizations.  The issue, is we have to protect the pointer from ever
having a value that is less then the active area of the stack on some
systems, and have to preserve the general value of the pointer.  These
two facets are very hard to express in the current infrastructure, I
think.  Maybe if we just extend the current code to solve specific
instances like the above, it would be enough.

:-)


More information about the Gcc mailing list