This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
---------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]