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: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 23 Oct 2001 14:14:55 +0200
- Cc: gcc-patches at gcc dot gnu dot org
- References: <ork7xmbrxp.fsf@free.redhat.lsd.ic.unicamp.br>
> 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