This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Initialize previous in read_state_param_structs
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 30 May 2011 12:26:50 +0200
- Subject: Re: Initialize previous in read_state_param_structs
- References: <ork4d8348z.fsf@livre.localdomain>
On 05/30/2011 11:51 AM, Alexandre Oliva wrote:
> 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?
Ok. Alternatively you could fix the warning and shorten the code using
the pprev trick.
Bernd