From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3013 invoked by alias); 16 Jan 2014 12:18:30 -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 2940 invoked by uid 55); 16 Jan 2014 12:18:26 -0000 From: "nickc at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/28865] Structures with a flexible arrray member have wrong .size Date: Thu, 16 Jan 2014 12:18: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: nickc at gcc dot gnu.org 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/msg01681.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28865 --- Comment #26 from Nick Clifton --- Author: nickc Date: Thu Jan 16 12:17:48 2014 New Revision: 206661 URL: http://gcc.gnu.org/viewcvs?rev=206661&root=gcc&view=rev Log: PR middle-end/28865 * varasm.c (output_constant): Return the number of bytes actually emitted. (output_constructor_array_range): Update the field size with the number of bytes emitted by output_constant. (output_constructor_regular_field): Likewise. Also do not complain if the total number of bytes emitted is now greater than the expected fieldpos. * output.h (output_constant): Update prototype and descriptive comment. * gcc.c-torture/compile/pr28865.c: New. * gcc.c-torture/execute/pr28865.c: New. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr28865.c trunk/gcc/testsuite/gcc.c-torture/execute/pr28865.c Modified: trunk/gcc/ChangeLog trunk/gcc/output.h trunk/gcc/testsuite/ChangeLog trunk/gcc/varasm.c