This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/16890] [cygwin/mingw32] __m128 automatic variables misaligned
- From: "matt dot daws at cantab dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2004 16:49:06 -0000
- Subject: [Bug target/16890] [cygwin/mingw32] __m128 automatic variables misaligned
- References: <20040805224647.16890.dannysmith@users.sourceforge.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From matt dot daws at cantab dot net 2004-08-18 16:49 -------
Sorry: I have confirmed my analysis, at least in some sense. If I manually
inline the function foo() into main() (i.e. cut-n-paste) then the resulting
binary does segfault. This is because the assembly output is the same, but the
stack is now actually aligned (rather than aligned +/-8). Of course, this
follows from the assembly output: the "andl $16, %%esp" aligns the stack, but
*we have already* copied %esp to %ebp, so that %ebp is not aligned in main().
After playing with threads in MinGW, one gets similar problems in threads.
Basically, it seems that proper functions get a stack aligned +/-8, but that
main() and any function called via a new thread command will have a stack which
is truly aligned. Of course, the compiler cannot know what is a true function,
and what will be called by a thread.
Can anyone tell me if this is correct?
--Matt
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16890