From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29133 invoked by alias); 11 Oct 2002 00:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 29115 invoked by uid 71); 11 Oct 2002 00:46:02 -0000 Date: Thu, 10 Oct 2002 17:46:00 -0000 Message-ID: <20021011004602.29112.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Ian Ollmann Subject: Re: optimization/8049: SSE unaligned vector stores crash with -O0 Reply-To: Ian Ollmann X-SW-Source: 2002-10/txt/msg00438.txt.bz2 List-Id: The following reply was made to PR optimization/8049; it has been noted by GNATS. From: Ian Ollmann To: Jan Hubicka Cc: hubicka@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 : 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 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 ---------------------------------------------------