> Ideally we'd have a test that we could more deeply analyze for paths
> through the CFG that can't be executed. Finding those paths usually
> both fixes the warning *and* results in better code. Even if we
> can't fix it now, we can file it away for future work
It's multiple variables who are depending on each other, with complex
control flow inbetween. It's not surprising that it loses control
of all the combinations.
You can take a look yourself here:
/home/andi/gcc/git/gcc/gcc/tree-vrp.c: In function 'int
compare_values_warnv(tree, tree, bool*)':
/home/andi/gcc/git/gcc/gcc/tree-vrp.c:1251:12: error: 'inv2' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
tree inv = cst1 ? inv2 : inv1;
^~~
/home/andi/gcc/git/gcc/gcc/tree-vrp.c:1222:4: error: 'inv1' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
if (strict_overflow_p != NULL
~~~~~~~~~~~~~~~~~~~~~~~~~
&& (!inv1 || !TREE_NO_WARNING (val1))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Andi