Re: Preventing gcc from aligning stack???

From: Jamie Lokier (lkd@tantalophile.demon.co.uk)
Date: Tue Jan 25 2000 - 11:12:58 EST


Tuukka Toivonen wrote:
> > 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
>
> I'd like to ask, why? Even double is only 8 bytes. Does this mean that 12
> bytes is wasted each argumentless call and -fno-omit-frame-pointer, for
> saving ebp?

Yes. And gcc does tend to emit redundant stack alignment instructions
too (though this is being improved).

So turning off stack alignment reduces stack usage _and_ reduces the
code size.

-- Jamie

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



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:15 EST