From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6445 invoked by alias); 22 Apr 2008 07:28:21 -0000 Received: (qmail 6301 invoked by uid 48); 22 Apr 2008 07:27:39 -0000 Date: Tue, 22 Apr 2008 07:28:00 -0000 Subject: [Bug c/36004] New: gcc bug on alpha X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "oliver at linux-kernel dot at" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg01526.txt.bz2 Testcase: #include #include struct Tst { unsigned char data[1]; }; int main(void) { struct Tst *tst = malloc(sizeof(struct Tst) + 10); unsigned char *tmp = tst->data; tst->data[0] = 0; tmp[0] = 1; tmp[1] = 2; printf("%x %x\n", tmp[0], tmp[1]); printf("%x %x\n", tst->data[0], tst->data[1]); printf("%p %p\n", &tmp[0], &tmp[1]); printf("%p %p\n", &tst->data[0], &tst->data[1]); return 0; } Produces on x86_64 (Dell PC, Core 2 Duo) 1 2 1 2 0x601010 0x601011 0x601010 0x601011 Produces on alpha (DS10, EV67, Fedora 8) 1 2 1 1 0x120012010 0x120012011 0x120012010 0x120012011 Produces on ia64 (SLES 10.1) 1 2 1 2 0x6000000000004010 0x6000000000004011 0x6000000000004010 0x6000000000004011 If you need access to an alpha, I can arrange this! Sorry, if the component is wrong. -- Summary: gcc bug on alpha Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: oliver at linux-kernel dot at GCC build triplet: alpha-redhat-linux GCC host triplet: alpha-redhat-linux GCC target triplet: alpha-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36004