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:05:05 -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:04 -------
As I have an interest in this family of bugs being fixed, I thought I'd chime in
here. Firstly, with GCC 3.4.1, I cannot replicate the bug, and the assmebly
output is slightly different. However, the MOVAPS and MULSS instructions are
the same. I get the same result with GCC 3.3.3 (all using -O2 -msse), and using
MinGW, of course.
Now, my understanding of the assembly is as follows: in _main, the "andl $-16,
%esp" will align the stack to 16-bytes. We then call __alloca and ___main,
which for the moment I'll assume do not mess with the stack. Then we call _foo
which pushes 4 bytes to the stack. Then, in _foo, we push %ebp, so 8 bytes are
now on the stack, and then set %ebp=%esp. Thus %ebp+8 is aligned to a 16-byte
boundary. This makes sense, as then the MOVAPS and MULSS instructions ARE aligned.
I don't see why your test case crashes then. My only thought is that ___main
and __alloca somehow DO mess with the stack: this might explain how the binary
you produce dies and mine doesn't.
Can anyone confirm or correct my analysis? Danny: I take it you are using gcc
3.5.0?
Thanks, --Matt Daws
--
What |Removed |Added
----------------------------------------------------------------------------
Summary| [cygwin/mingw32] __m128 |[cygwin/mingw32] __m128
|automatic variables |automatic variables
|misaligned |misaligned
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16890