From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13074 invoked by alias); 7 May 2015 21:55:58 -0000 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 Received: (qmail 13041 invoked by uid 48); 7 May 2015 21:55:54 -0000 From: "darpeer at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66060] New: struct member allocation off. Date: Thu, 07 May 2015 21:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: darpeer at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg00640.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66060 Bug ID: 66060 Summary: struct member allocation off. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: darpeer at hotmail dot com Target Milestone: --- Using gdb, two struct members end up at the same offset. gcc (GCC) 6.0.0 20150418 (experimental) and older. gcc -c -O0 -ggdb3 struct-example.C cat struct-example.C struct ODD_S { char a[/*0x2000 */ 2097152]; char b[/*0x400 */ 536870912]; char c[/*0x8000 */ 33554432]; } l_; (gdb) p &l_.a $1 = (char (*)[2097152]) 0x0 (gdb) p &l_.b $2 = (char (*)[536870912]) 0x200000 (gdb) p &l_.c $3 = (char (*)[33554432]) 0x200000