This is the mail archive of the gcc-patches@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: i386 stack missalignment on main


> 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


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