This is the mail archive of the
mailing list for the GCC project.
Re: patch to handle i386 stack alignment using PREFERRED_STACK_BOUNDARY
- To: John Wehle <john at feith dot com>
- Subject: Re: patch to handle i386 stack alignment using PREFERRED_STACK_BOUNDARY
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 22 Mar 1999 00:40:37 -0700
- cc: egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199901270647.BAA16923@jwlab.FEITH.COM>you write:
> This patch causes gcc to maintain the i386 PREFERRED_STACK_BOUNDARY
> alignment. It works by adjusting the amount of local storage allocated by
> the prologue.
> 1) The patch doesn't actually define PREFERRED_STACK_BOUNDARY. However
> if you do define it then this patch is necessary for it to work on
> the i386.
> 2) In order to be useful "recommended alignment for local i386 FP
> variables patch (version 2)" should be installed.
> 3) The performance results need to be taken with a grain of salt since
> there appears to be a problem will how calls.c maintains the
> alignment when faced with nested calls. Also I don't known if the
> startup code on the platform used aligns the stack on a 64 bit
> 4) There are no regressions with the testsuite on FreeBSD 3.0.
Thanks. I played around with this a little. Specifically I installed this
patch along with a patch of my own to define PREFERRED_STACK_BOUNDARY.
The results were generally quite negative. A ~8% drop in spec92fp with
the majority of tests getting slower and very few improving.
I suspect somewhere we get an unaligned stack, and it just propagates
through all the code and we lose badly.
I've also done some reading on the subject (Intel, AMD and other docs) and
they generally recommend using the other method (align the stack via the
prologue and burn the extra register as needed).
So the PREFERRED_STACK_BOUNDARY may be a dead end.