https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110228

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Phiopt does this:
```
        v_13 == 1 ? 1 : LookupFlags_6
Matching expression match.pd:1990, gimple-match-5.cc:23
Matching expression match.pd:1990, gimple-match-5.cc:23
Matching expression match.pd:2479, gimple-match-4.cc:35
Matching expression match.pd:2482, gimple-match-3.cc:66
Matching expression match.pd:2489, gimple-match-2.cc:58
Matching expression match.pd:1947, gimple-match-7.cc:20
Applying pattern match.pd:4742, gimple-match-7.cc:15326
Folded into the sequence:
_17 = v_13 == 1;
_18 = LookupFlags_6 | _17;
Removing basic block 5
;; basic block 5, loop depth 1
;;  pred:       4
;;  succ:       6
```
As zero_one_valued_p returns true for LookupFlags_6 because
tree_nonzero_bits/get_nonzero_bits returns 1 for it.

So it is ranger in the end that returns that it has a nonzero bits of 1.
Which is completely wrong as LookupFlags_6 is defined by:
  # LookupFlags_6 = PHI <LookupFlags_9(D)(2), LookupFlags_5(5)>


Which has an uninitialized variable in it which is not defined at what its
value would be ....

Reply via email to