Stack alignment bug is still there! [was Re: Stack alignment]
Steven G. Johnson
stevenj@hunsmac.mit.edu
Thu Jan 20 13:31:00 GMT 2000
I corresponded with David about his Jan. 18 post, and it turns out that he
was in error--the bug is *still present* in gcc 2.95.2. (He had
inadvertently rendered my test program meaningless by compiling with -O3,
which inlined all of the functions.)
To recap, there is a bug in the x86 stack alignment feature of gcc-2.95.2,
as described in my earlier post(s):
http://gcc.gnu.org/ml/gcc-bugs/1999-11/msg00445.html
Important points:
* gcc can misalign the stack even when main() was initially aligned. (I
checked explicitely for main()'s alignment, and one can also identify the
exact site of the misalignment in the assembly output--see the above URL.)
* The misalignment occurs for nested function calls f(g(x)). (See above
URL for a test program. Compile *without* optimization to avoid inlining
the functions.)
* A misaligned stack can cause serious performance degredation (on Pentia
and later x86) when accessing double-precision variables.
I hope that one of the gcc developers will be able to look into this
problem at some point. Don't hesitate to email me if you have any comments
or questions.
Cordially,
Steven G. Johnson
More information about the Gcc-bugs
mailing list