This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Stack alignment bug is still there! [was Re: Stack alignment]
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Stack alignment bug is still there! [was Re: Stack alignment]
- From: stevenj at hunsmac dot mit dot edu (Steven G. Johnson)
- Date: Thu, 20 Jan 2000 16:30:09 -0500
- Cc: ronis at onsager dot chem dot mcgill dot ca
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