This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -foptimize-sibling-calls and passing structs


> 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.

:-)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]