This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Tue, 23 Oct 2001 11:30:30 +0100 (BST)
- cc: <gcc-patches at gcc dot gnu dot org>
On 23 Oct 2001, Alexandre Oliva wrote:
> One of our customers complained about the additional code generated to
> maintain the stack aligned to 16-byte boundaries, and suggested us to
> default to the minimum alignment when optimizing for code size. This
> has the caveat that, when you link code optimized for size with code
> optimized for speed, if a function optimized for size calls a
> performance-critical function with the stack misaligned, the
> performance-critical function may perform poorly.
>
> I'm considering introducing a function attribute to specify the
> alignment requirements of a given function, with similar effects to
> RTH's FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN, so that one can control
> performance-critical (re-)entry points that would benefit from
> additional alignment. I suppose this would address most of the
> concerns discussed in the long thread starting at
> http://gcc.gnu.org/ml/gcc/2001-07/msg00404.html. Comments?
>
> Meanwhile, is this ok to install? Build- and hand-tested on
> athlon-pc-linux-gnu.
Ok. I'd still like us to default to a boundary of 2, but I doubt we'll
achieve consensus on that.
Bernd