[Bug tree-optimization/32759] False claim of that "xyz is used uninitialized"

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 22 16:49:00 GMT 2007



------- Comment #4 from manu at gcc dot gnu dot org  2007-08-22 16:49 -------
Basically, when we reach "diff = xlimit;" we don't know that xlimit must be
initialized. This may end up in different scenarios depending on the SSA tree
finally generated. In any of those scenarios, not warning is sheer luck.

If you remove the assignment to diff, still when we reach "ang ? xlimit : 0.0;"
we don't know that xlimit is always initialized. We get the "may be" because we
don't know the value of "ang", so xlimit may not be used at all.

Finally, I guess that using constants make the warning disappear because the
constant-propagation pass assumes that the uninitialized value of xlimit is
either of the constants and thus xlimit is never used uninitialized.

My conclusion here is that we should not get a "is uninitialized". Maybe we can
use the fact that the block is not entered 100% of times to avoid saying "is
used"? 

Nonetheless, avoiding the warning completely depends on being able to avoid a
default case for the switch (which is a missed-optimization in VRP and not a
diagnostics problem).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32759



More information about the Gcc-bugs mailing list