Dynamic stack alignment for i386

Jan Hubicka jh@suse.cz
Wed May 29 05:47:00 GMT 2002


> This patch adds the ability to align the stack dynamically at run time.
> Credit for most of this work goes to Catherine Moore; I hope I managed
> to get all the relevant pieces out of Red Hat's tree.  Bootstrapped and
> regression tested on i686-linux.
> 
> The stack pointer is and-ed with an appropriate mask at function entry;
> to be able to access the arguments, we use %esi as argument pointer.
> There are two entry points, one which does the forced alignment, and
> another which assumes the stack was aligned on entry.  If we detect a
> call to another function that was defined in the same source file, we
> call the aligned entrypoint.  All of this is essentially what is
> recommended in Intel's documentation.
> 
> I haven't checked this in yet; I want to get a bit of feedback first.
> When do we want to enable this code?  Whenever -mmmx/-msse/-msse2 is
> enabled?  Do we want to reduce PREFERRED_STACK_ALIGNMENT to 64 again for
> normal compilations (I'd personally prefer 32, but...)?

Another question.  Last time I was playing with LABEL_ALTERNATE_NAME I
run into problems with stack unwinding algorithm, as it did misset the
fact that label is another entry point and got angry on the duplicated
prologue of function.
Has this been solved somehow?

Honza



More information about the Gcc-patches mailing list