On 08/11/2016 09:28 PM, Andi Kleen wrote:
If sym1 results in a return value that is some useful tree and inv1
is true and cst1 is true via this call:
The only way for get_single_symbol to return a non NULL tree
is to hit the return at the end -- and that always initializes
inv and neg.
Right.
And when the return is NULL the && prevents evaluating
inv or neg.
Consider the case where sym1 results in a non-null return value (and
initializes neg1/inv1), but sym2 results in a null return value, leaving
neg2/inv2 undefined, but cst2 is can still be true (ADDR_EXPR with an
invariant address comes to mind).
Thus we can get into these statements:
tree cst = cst1 ? val1 : val2;
tree inv = cst1 ? inv2 : inv1;
Note carefully how they test cst1 and depending on its value, they may
read val2 or inv2.
Jeff