From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18252 invoked by alias); 13 Apr 2003 22:46:01 -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 18231 invoked by uid 71); 13 Apr 2003 22:46:00 -0000 Resent-Date: 13 Apr 2003 22:46:00 -0000 Resent-Message-ID: <20030413224600.18230.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, vgrebinski@yahoo.com Received: (qmail 18115 invoked from network); 13 Apr 2003 22:44:46 -0000 Received: from unknown (HELO vag.ddts.net) (67.85.191.178) by sources.redhat.com with SMTP; 13 Apr 2003 22:44:46 -0000 Received: from grebinsk by vag.ddts.net with local (Exim 3.36 #1 (Debian)) id 194qDD-00059z-00; Sun, 13 Apr 2003 18:44:35 -0400 Message-Id: Date: Sun, 13 Apr 2003 22:46:00 -0000 From: vgrebinski@yahoo.com To: gcc-gnats@gcc.gnu.org Cc: vgrebinski@yahoo.com X-Send-Pr-Version: 3.113 Subject: target/10395: sse2 datatype is not 16bytes aligned in threaded code X-SW-Source: 2003-04/txt/msg00584.txt.bz2 List-Id: >Number: 10395 >Category: target >Synopsis: sse2 types are incorrectly aligned causing crash in multi-threaded apps >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Apr 13 22:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Vladimir Grebinskiy >Release: 3.3 20030410 (prerelease) >Organization: >Environment: System: Linux vag 2.4.21-pre5 #2 Sun Mar 2 00:28:31 EST 2003 i686 unknown unknown GNU/Linux Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: /build/packages/gcc/snap/gcc-snapshot-20030410/src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr/lib/gcc-snapshot --infodir=/share/info --mandir=/share/man --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-java-awt=xlib --with-cpp-install-dir=bin --enable-multilibs --enable-objc-gc i386-linux >Description: support for sse2 instruction is an important addtion to gcc-3.3. Unfortunately, code generated for functions called via pthread_create() does not provide 16bytes alignment for local sse2 data, which causes crash when these variables are used. >How-To-Repeat: The following short program demonstrates problem. The second call to function "f" shows that variable is not aligned to 16 bytes: /* *** start ***/ #include #include #include #include #include #ifdef __ICC #include #endif void * f(void *p) { int x = (p == NULL) ? 0 : * (int *) p; __m128i s; printf("&x = %p &s= %p\n", &x, &s); return NULL; } int main(int argc, char ** argv) { pthread_t th; f(& argc); assert(pthread_create(& th, NULL, f, &argc)==0); assert(pthread_join(th, NULL)==0); return 0; } /* ***end *** / $ /usr/lib/gcc-snapshot/bin/gcc -pthread -msse2 gcc_test.c -o gcc_test.LINUX $ ./gcc_test.LINUX &x = 0xbffffb6c &s= 0xbffffb50 &x = 0xbf7ffae8 &s= 0xbf7ffacc <---- error >Fix: don't know >Release-Note: >Audit-Trail: >Unformatted: