This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix uninitialized error with BUILD_CONFIG=bootstrap-O1


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]