This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -foptimize-sibling-calls and passing structs
- To: egcs at tantalophile dot demon dot co dot uk, skawina at geocities dot com
- Subject: Re: -foptimize-sibling-calls and passing structs
- From: Mike Stump <mrs at windriver dot com>
- Date: Mon, 5 Jun 2000 16:25:57 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> 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.
:-)