This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix uninitialized error with BUILD_CONFIG=bootstrap-O1
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 18:49:41 +0200
- Subject: Re: Fix uninitialized error with BUILD_CONFIG=bootstrap-O1
- References: <orr5kfnp22.fsf@livre.localdomain>
> I suppose -O2 infers that new_ptr can't be NULL because it's
> dereferenced before, so last will always be set before we exit the loop,
> but at -O1 it doesn't.
>
> This patch avoids the warning, but perhaps the loop should be turned
> into a do/while loop to avoid the unnecessary test.
The most correct version is 'last = NULL_TREE' but then the line overflows.
So I'd initialize 'last' to NULL_TREE in its declaration; OK with this change.
--
Eric Botcazou