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


> 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

Problem of this sollution is combining -Os modules with -O2.  It makes sense
to compile internal loop by -O2/-O3 and rest with -Os.  I am doing that in
XaoS zoomer to avoid bloat from user interface and it works well.

Honza

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


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