From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4854 invoked by alias); 15 Nov 2008 20:42:12 -0000 Received: (qmail 28464 invoked by uid 48); 15 Nov 2008 20:40:48 -0000 Date: Sat, 15 Nov 2008 20:42:00 -0000 Message-ID: <20081115204048.28463.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/38136] vim crashes on startup when compiled with -O3 but works with -O2 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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-11/txt/msg01243.txt.bz2 ------- Comment #3 from rguenth at gcc dot gnu dot org 2008-11-15 20:40 ------- Note that ... struct dictitem_S { typval_T di_tv; /* type and value of the variable */ char_u di_flags; /* flags (only used for variable) */ char_u di_key[1]; /* key (actually longer!) */ }; 227 struct /* fixed variables for arguments */ 228 { 229 dictitem_T var; /* variable (without room for name) */ 230 char_u room[VAR_SHORT_LEN]; /* room for the name */ 231 } fixvar[FIXVAR_CNT]; room makes fixvar[].var.di_key no longer a tra iling array. Crossing objects from di_key to room is not allowed by the C standard. You may instead want to do union { dictitem_t var; char_u room[sizeof(dictitem_t) + VAR_SHORT_LEN]; } fixvar[FIXVAR_CNT]; which should be valid (I might have to doubl-check the standard though). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38136