This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: i386 stack missalignment on main
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: i386 stack missalignment on main
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 31 Jul 2001 13:02:48 +0200
- Cc: Joern Rennecke <amylaar at redhat dot com>, Jan Hubicka <jh at suse dot cz>, Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org, aj at suse dot de, gcc-patches at gcc dot gnu dot org
- References: <200107310212.f6V2Cpr08828@phal.cambridge.redhat.com> <orbsm1c05y.fsf@feijoada.lsd.ic.unicamp.br>
> Precisely. That's why I suggest we should no longer eliminate the
> argument pointer in favor of the frame pointer, and that the frame
> pointer could no longer be eliminated.
>
> > Moreover, you'd have to restore the frame pointer at the function
> > end.
>
> Indeed. Do you see an alternative?
I was working on the dynamic stack alignment code based on work Cygnus
done some time ago.
What basically needs to be done is
1) align stack pointer and keep frame pointer if function does not use
alloca. Then we can access aligned frame using stack pointer and
arguments using frame pointer
2) In case function use alloca, we need an aligned frame pointer and
an argument pointer. This is tricky, as we can't burn away another
hard register on i386, so argument pointer should be pseudo. HP
does that, but problem is that we should use this only when 1)
is not applicable. Only approach I was able to come with is to
change argument pointer to pseudo in machine depdendent part once
code generation is complette.
Honza
>
> --
> Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist *Please* write to mailing lists, not to me