range-ops: (nonzero | X) is nonzero
authorAldy Hernandez <aldyh@redhat.com>
Mon, 14 Jun 2021 10:51:48 +0000 (12:51 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Tue, 15 Jun 2021 16:41:09 +0000 (18:41 +0200)
commit4602714382f7a4603290b1ceb3121d9187debdb9
treec6b6cc3441a3622800e7608583b9811690db7ed3
parent913b13fcb1dceea0e57a04cb77b11097b132cbf6
range-ops: (nonzero | X) is nonzero

For bitwise or, nonzero|X is always nonzero.  Make sure we don't drop to
varying in this case.

gcc/ChangeLog:

* range-op.cc (operator_bitwise_or::wi_fold): Make sure
nonzero|X is nonzero.
(range_op_bitwise_and_tests): Add tests for above.
gcc/range-op.cc