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: Arranging for -Os to imply -mpreferred-stack-boundary=2 on x86


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


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