optimization/8049: SSE unaligned vector stores crash with -O0

Ian Ollmann iano@cco.caltech.edu
Thu Oct 10 17:46:00 GMT 2002


The following reply was made to PR optimization/8049; it has been noted by GNATS.

From: Ian Ollmann <iano@cco.caltech.edu>
To: Jan Hubicka <jh@suse.cz>
Cc: hubicka@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>,
        <gcc-gnats@gcc.gnu.org>
Subject: Re: optimization/8049: SSE unaligned vector stores crash with -O0
Date: Thu, 10 Oct 2002 17:45:16 -0700

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



More information about the Gcc-prs mailing list