On Thu, 10 Nov 2016, Richard Biener wrote:
The following fixes PR71762 via reverting the transforms of ~X & Y to X < Y and similar because when the bools they apply to are expanded to RTL undefined values are not reliably zero-extended and thus the transform is invalid. Ensuring the zero-extension is too costly IMHO and the proper fix is to move the transform to RTL where we can check known-zero-bits to validate validity or to fix GIMPLE not not have operations on types not matching their mode in precision.
Can you explain why this particular transformation is special? We have a number of other optimizations that take advantage of the fact that bool is in [0, 1], even without looking at VRP, say for instance x != 0 -> x. Are we supposed to remove all of them?
-- Marc Glisse