From patchwork Mon May 30 09:51:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Initialize previous in read_state_param_structs Date: Sun, 29 May 2011 23:51:56 -0000 From: Alexandre Oliva X-Patchwork-Id: 97898 Message-Id: To: gcc-patches@gcc.gnu.org Bootstrap-O3 complains about uninitialized uses of this variable in gengtype-state.c. The variable can never actually be used before initialization, but GCC is not smart enough to realize that. read_state_structures, just before the function at hand, has a similar loop and it zero-initializes both head and previous, so I adjusted the affected function to follow the same pattern and avoid the bogus warning. Regstrapped on x86_64-linux-gnu and i686-pc-linux-gnu. Ok to install? for gcc/ChangeLog from Alexandre Oliva * gengtype-state.c (read_state_params_structs): Initialize previous. Index: gcc/gengtype-state.c =================================================================== --- gcc/gengtype-state.c.orig 2011-05-18 05:02:28.341594395 -0300 +++ gcc/gengtype-state.c 2011-05-18 05:02:32.710587356 -0300 @@ -2137,7 +2137,7 @@ read_state_param_structs (type_p *param_ int nbparamstructs = 0; int countparamstructs = 0; type_p head = NULL; - type_p previous; + type_p previous = NULL; type_p tmp; struct state_token_st *t0 = peek_state_token (0); struct state_token_st *t1 = peek_state_token (1);