From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20419 invoked by alias); 18 Jan 2005 22:11:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20285 invoked by uid 48); 18 Jan 2005 22:11:01 -0000 Date: Tue, 18 Jan 2005 22:11:00 -0000 From: "ebotcazou at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050118221058.19515.ebotcazou@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/19515] New: [4.0 Regression] Violation of C99 6.7.8 §21 X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg02508.txt.bz2 List-Id: typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned long long upad64_t; typedef struct _pthread_mutex { struct { uint16_t __pthread_mutex_flag1; uint8_t __pthread_mutex_flag2; uint8_t __pthread_mutex_ceiling; uint16_t __pthread_mutex_type; uint16_t __pthread_mutex_magic; } __pthread_mutex_flags; union { struct { uint8_t __pthread_mutex_pad[8]; } __pthread_mutex_lock64; struct { uint32_t __pthread_ownerpid; uint32_t __pthread_lockword; } __pthread_mutex_lock32; upad64_t __pthread_mutex_owner64; } __pthread_mutex_lock; upad64_t __pthread_mutex_data; } pthread_mutex_t; void foo(void) { pthread_mutex_t tmp = {{0, 0, 0, 0, 0x4d58}, {{{0}}}, 0}; } On SPARC64 at -O0: sth %g0, [%fp+2007] stb %g0, [%fp+2009] stb %g0, [%fp+2010] sth %g0, [%fp+2011] sethi %hi(19456), %g1 or %g1, 344, %g1 sth %g1, [%fp+2013] stb %g0, [%fp+2015] stx %g0, [%fp+2023] On AMD64 at -O0: movw $0, -32(%rbp) movb $0, -30(%rbp) movb $0, -29(%rbp) movw $0, -28(%rbp) movw $19800, -26(%rbp) movb $0, -24(%rbp) movq $0, -16(%rbp) Note the 'b' on the last but one line in both cases: __pthread_mutex_pad is not initialized according to the ISO C99 rules. This is critical on Solaris 64-bit as it affects POSIX thread support. The C++ and Objective-C compilers are also affected. -- Summary: [4.0 Regression] Violation of C99 6.7.8 §21 Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ebotcazou at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: *-*-* GCC host triplet: *-*-* GCC target triplet: *-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19515