From: Richard Henderson Date: Fri, 26 Mar 2004 22:37:18 +0000 (-0800) Subject: re PR c/11527 (If an array "designated intializer" in a struct causes a segv.) X-Git-Tag: releases/gcc-3.3.4~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bec9aa35353503e4ffd1d32b858e4dcce7cfff5;p=thirdparty%2Fgcc.git re PR c/11527 (If an array "designated intializer" in a struct causes a segv.) PR 11527 * c-typeck.c (pop_init_level): Emit pending init elements earlier rather than later. From-SVN: r79999 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fedfb4341d2..377c78962d7d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-03-26 Richard Henderson + + PR 11527 + * c-typeck.c (pop_init_level): Emit pending init elements earlier + rather than later. + 2004-03-26 Jan Hubicka H.J. Lu @@ -90,9 +96,9 @@ 2004-03-15 Richard Henderson - PR middle-end/14535 - * except.c (collect_one_action_chain): Record action for cleanup - outer of exception spec. + PR middle-end/14535 + * except.c (collect_one_action_chain): Record action for cleanup + outer of exception spec. 2004-03-13 Dara Hazeghi @@ -126,7 +132,7 @@ Backport: 2004-03-13 Eric Botcazou - PR middle-end/14470 + PR middle-end/14470 * expr.c (store_expr): Call emit_queue before generating the move from the temporary to the original target. Protect the temporary from emit_queue. @@ -146,8 +152,8 @@ options. 2004-03-12 Gabriel Dos Reis - - Endorse: + + Endorse: 2004-01-10 Eric Botcazou PR optimization/13472 * reload.c (reload): Don't record unchanging memory locations. @@ -210,25 +216,25 @@ 2004-03-07 Aldy Hernandez - * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power - for little endian. - ("ashrdi3_no_power"): Disable for little endian. + * config/rs6000/rs6000.md (ashrdi3): Do not call ashrdi3_no_power + for little endian. + ("ashrdi3_no_power"): Disable for little endian. (ashrdi3): Same. 2004-03-07 Richard Henderson - * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. - (TARGET_LONG_DOUBLE_128): New. - (TARGET_SWITCHES): Add long-double-{128,64}. - (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. - (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. - (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. - (WIDEST_HARDWARE_FP_SIZE): New. - (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. - * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 - if TARGET_VAX_FLOAT. - * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. - (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. + * config/alpha/alpha.h (MASK_LONG_DOUBLE_128): New. + (TARGET_LONG_DOUBLE_128): New. + (TARGET_SWITCHES): Add long-double-{128,64}. + (TARGET_HAS_XFLOATING_LIBS): Default to TARGET_LONG_DOUBLE_128. + (LONG_DOUBLE_TYPE_SIZE): Honor TARGET_LONG_DOUBLE_128. + (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): New. + (WIDEST_HARDWARE_FP_SIZE): New. + (TARGET_CPU_CPP_BUILTINS): Define __LONG_DOUBLE_128__. + * config/alpha/alpha.c (override_options): Clear MASK_LONG_DOUBLE_128 + if TARGET_VAX_FLOAT. + * config/alpha/osf5.h (LONG_DOUBLE_TYPE_SIZE): Remove. + (TARGET_DEFAULT): Set MASK_LONG_DOUBLE_128. 2004-03-08 Hans-Peter Nilsson @@ -255,7 +261,7 @@ 2004-03-06 Richard Henderson - * config/alpha/alpha.c (alpha_in_small_data_p): False for functions. + * config/alpha/alpha.c (alpha_in_small_data_p): False for functions. 2004-03-05 Ulrich Weigand @@ -341,15 +347,15 @@ 2004-03-02 Richard Henderson - PR middle-end/11767 - * optabs.c (prepare_cmp_insn): Force trapping memories to registers - before the compare, if flag_non_call_exceptions. + PR middle-end/11767 + * optabs.c (prepare_cmp_insn): Force trapping memories to registers + before the compare, if flag_non_call_exceptions. 2004-03-02 Richard Henderson - PR middle-end/14327 - * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before - emitting the label, not after. + PR middle-end/14327 + * stmt.c (expand_computed_goto): Do do_pending_stack_adjust before + emitting the label, not after. 2004-03-02 Danny Smith @@ -365,9 +371,9 @@ constants as signed values. 2004-01-16 J"orn Rennecke - PR optimization/11864 - * reload1.c (reload_cse_simplify_operands): Don't remove - implicit extension from LOAD_EXTEND_OP. + PR optimization/11864 + * reload1.c (reload_cse_simplify_operands): Don't remove + implicit extension from LOAD_EXTEND_OP. 2004-02-29 Hans-Peter Nilsson @@ -502,7 +508,7 @@ * config/i386/i386.c: Rename pni to sse3. * config/i386/i386.h: Likewise. - * config/i386/i386.md: Likewise. + * config/i386/i386.md: Likewise. * config/i386/pmmintrin.h: Likewise. * doc/extend.texi: Likewise. * doc/invoke.texi: Likewise. @@ -552,10 +558,10 @@ 2004-01-23 Richard Henderson - PR opt/12941 - * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value. - (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0) - if SHIFT_COUNT_TRUNCATED is set. + PR opt/12941 + * combine.c (SHIFT_COUNT_TRUNCATED): Provide default value. + (simplify_comparison): Don't simplify (eq (zero_extract c 1 r) 0) + if SHIFT_COUNT_TRUNCATED is set. 2004-01-23 Ian Lance Taylor @@ -575,18 +581,18 @@ 2004-01-21 Ralf Corsepius PR target/13073 - * config/h8300/t-rtems (h8300-*-rtems*): New. - * config.gcc: Use config/h8300/t-rtems. + * config/h8300/t-rtems (h8300-*-rtems*): New. + * config.gcc: Use config/h8300/t-rtems. 2004-01-20 Gabriel Dos Reis - Backport from mainline + Backport from mainline - 2004-01-10 Jan Hubicka - PR opt/12826 - * loop.c (insert_loop_mem): Prefer VOLATILE memory references to be - stored. - + 2004-01-10 Jan Hubicka + PR opt/12826 + * loop.c (insert_loop_mem): Prefer VOLATILE memory references to be + stored. + 2004-01-16 Jan Hubicka PR opt/13608 @@ -594,16 +600,16 @@ 2004-01-16 Segher Boessenkool - PR target/11793 + PR target/11793 * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Handle vectors. 2004-01-16 Jan Hubicka - PR opt/11350 - * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal + PR opt/11350 + * cfgcleanup.c (try_optimize_cfg): Suppress tablejump removal after reload. - * cfgrtl.c (try_redirect_by_replacing_branch): Likewise. + * cfgrtl.c (try_redirect_by_replacing_branch): Likewise. 2004-01-15 J"orn Rennecke @@ -629,11 +635,11 @@ 2003-01-14 Nicola Pero PR objc/7993 - * objc-act.c (is_private): Do not emit the 'instance variable %s - is declared private' error. - (is_public): Emit the error after calling is_private. - (lookup_objc_ivar): If the instance variable is private, return 0 - - the instance variable is invisible here. + * objc-act.c (is_private): Do not emit the 'instance variable %s + is declared private' error. + (is_public): Emit the error after calling is_private. + (lookup_objc_ivar): If the instance variable is private, return 0 + - the instance variable is invisible here. 2004-01-12 Marc Espie @@ -641,10 +647,10 @@ 2004-01-12 Matthias Klose - Backport from mainline + Backport from mainline - 2003-12-08 Stuart Hastings - * config/i386/i386.md: Typo in split of fp-valued if_then_else. + 2003-12-08 Stuart Hastings + * config/i386/i386.md: Typo in split of fp-valued if_then_else. 2004-01-12 Roger Sayle @@ -699,10 +705,10 @@ Backport the following from mainline: 2003-03-08 Neil Booth - * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of - CPP_PREDEFINES. - * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of - CPP_PREDEFINES. + * config/sh/rtemself.h (TARGET_OS_CPP_BUILTINS): Use instead of + CPP_PREDEFINES. + * config/sh/rtems.h (TARGET_OS_CPP_BUILTINS): Use instead of + CPP_PREDEFINES. 2003-09-27 Kelley Cook * config/sh/rtemself.h, config/sh/rtems.h: GNU CC -> GCC. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index a3ef0f69fb59..b7807fb2d67c 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5499,6 +5499,10 @@ pop_init_level (implicit) abort (); } + /* Now output all pending elements. */ + constructor_incremental = 1; + output_pending_init_elements (1); + p = constructor_stack; /* Error for initializing a flexible array member, or a zero-length @@ -5553,10 +5557,6 @@ pop_init_level (implicit) } } - /* Now output all pending elements. */ - constructor_incremental = 1; - output_pending_init_elements (1); - /* Pad out the end of the structure. */ if (p->replacement_value) /* If this closes a superfluous brace pair,