This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8049: SSE unaligned vector stores crash with -O0
- From: Ian Ollmann <iano at cco dot caltech dot edu>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: hubicka at gcc dot gnu dot org, <gcc-bugs at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <gcc-gnats at gcc dot gnu dot org>
- Date: Thu, 10 Oct 2002 17:45:16 -0700
- Subject: Re: optimization/8049: SSE unaligned vector stores crash with -O0
On Thu, 10 Oct 2002, Jan Hubicka wrote:
> This really is load, however it is stored previously as:
> > 0x80484c9 <MatrixMultiply+177>: movaps %xmm0,0xffffff68(%ebp)
>
> And it didn't generated trap, so ebp is aligned that time I suppose,
> so it is really strange to see that it is not in this case.
> Perhaps it is _mm_store_ps that messed up the stack and restored ebp
> incorrectly?
I checked. I stepped through the entire function. %esp stays the same the
whole time (so long as we are in MatrixMultiply and after return from
various sub functions) and is 16 byte aligned. The problem is that the
compiler seems to have generated a 4 byte offset from the 16 byte aligned
stack pointer and tried to do an align vector store there. For the other
earlier stores, the offset is an even multiple of 16 bytes.
0x804888b <MatrixMultiply+1139> movaps %xmm0, 0x4(%esp,1)
^^^
esp: 0xbffff790
The store looks to me like a write to pass the vector on the stack, just
before the call is made.
Perhaps it is time to reopen this bug? I think this is a compiler
alignment bug. It happens for nearly every call to _mm_store_ps() if -O0
is set.
Ian
---------------------------------------------------
Ian Ollmann, Ph.D. iano@cco.caltech.edu
---------------------------------------------------