This is the mail archive of the
mailing list for the GCC project.
Re: Dubious "'foo' might be used uninitialized in this function" message
On Wed, Dec 15, 2004 at 07:05:48AM -0500, Robert Dewar wrote:
> Dmitry Antipov wrote:
> >> it gets as complex as the halting problem :)
> > Really ? Why ?
> Because the general evaluation of compile time contants
> is clearly in this territory. Your example:
> [ deleted ]
> requires the compiler to do symbolic evaluation of the
> tests in lines 7 and 10 and determine that they always
> have the same truth value.
This case and many other common cases that gcc gives false reports
on could be solved by using a gated SSA approach (which would, as you
suggest, determine that the two tests have the same truth value).
However, using such an approach goes against the desire by many people
that the warnings they get at -O0 be the same as those for higher levels.