From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14193 invoked by alias); 10 Jan 2014 22:51: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 14147 invoked by uid 48); 10 Jan 2014 22:51:55 -0000 From: "amodra at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/28865] Structures with a flexible arrray member have wrong .size Date: Fri, 10 Jan 2014 22:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amodra at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: 2014-01/txt/msg01202.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #16 from Alan Modra --- Hi Nick, that patch looks exactly like my first attempt to fix this bug. I forget the details now but I'm fairly certain it wasn't a complete fix, which is why I didn't submit my patch.. Note that the underlying bug here doesn't just cause a wrong .size to be emitted, but wrongly sized initialization data. On -fsection-anchors targets that results in seriously wrong code. Variables following a too-large initializer are located at the wrong address.. See http://gcc.gnu.org/ml/gcc-patches/2013-05/msg00246.html for a patch that makes the assembler complain loudly if gcc emits wrong code.