On Thu, 29 Jun 2023, Richard Biener wrote:
IIRC we have some simplification rules that turn bit operations into
arithmetics. Arithmetic is allowed if it keeps the values inside
[-1,0] for signed bools or [0, 1] for unsigned bools.
I have now verified that all cases seems to be just one operation of this
form (where _127 has the value 0 or 1), so it cannot construct values
such as 42. But the wide signed Boolean can have the three different
values 1, 0, and -1, which I still think is at least one too many. :)
Yeah, I'd be interested in a testcase that shows this behavior.
I created PR 110487 with one example.
I'll update my tool to complain if the value is outside the range [-1, 1].
It is likely that all issues I have seen so far are due to PR 110487, so
I'll keep the current behavior that complains if the value is outside the
range [-1, 0].
/Krister