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


On Jul 30, 2001, Jan Hubicka <jh@suse.cz> wrote:

> Mon Jul 30 15:25:00 CEST 2001  Jan Hubicka  <jh@suse.cz>

> 	* i386.c (ix86_output_main_function_alignment_hack): New function.
> 	(TARGET_ASM_FUNCTION_PROLOGUE): Default to it.

I believe it would be a better strategy to have a define_expand that
could be used to get the frame pointer aligned to any power of two.

I'm not sure whether this could be portably expanded after the
prologue, but at least we could have tests that would make sure the
frame pointer is not eliminated in favor of the stack pointer, and the
argument pointer is not eliminated in favor of the frame pointer, when
we introduce such stack-alignment in a function.

Then, we could have functions specify their own stack alignment
requirements upfront, or in automatic variables in their stack frames,
and we could generate alignment automatically and transparently.

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