lkml.org 
[lkml]   [2000]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Preventing gcc from aligning stack???
Date
From
Jeff Garzik <jgarzik@mandrakesoft.com> said:
> Is this really necessary in modern gcc versions, such as 2.95 and
> thereafter?
>
> Snip 2.3.x arch/i386/Makefile:
>
> # prevent gcc from keeping the stack 16 byte aligned
> CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null
> -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2";
> fi)

Yes it is. New gcc's (try to) keep the stack aligned at 16 bytes. The
kernel stack is 8Kb on ia32; the 16byte alignment is mostly for floating
point performance on Pentium and up, and floating point is forbidden in the
kernel anyway. So this is a sizeable savings for negligible performance
impact.

My question in this vein would be the -fno-strength-reduce. The gcc bug
that placed this in the kernel was in gcc-2.7.2, and was worked around in
2.7.2.3 by just making this option unconditional. Both 2.2.15pre4 and
2.3.41pre2 at least demand gcc-2.7.2.3 as minimal version.
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viña del Mar, Chile +56 32 672616


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.090 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site