Preventing gcc from aligning stack???
Horst von Brand
vonbrand en sleipnir.valparaiso.cl
Dom Ene 23 23:05:55 CST 2000
Jeff Garzik <jgarzik en 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 en 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 en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda