mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
Fix bitwise_or logic for prange.
Set non-zero only if at least one of the two operands does not contain zero. * range-op-ptr.cc (operator_bitwise_or::fold_range): Fix logic for setting nonzero.
This commit is contained in:
parent
7c0e4963d5
commit
1c0ecf06c0
@ -388,7 +388,7 @@ operator_bitwise_or::fold_range (prange &r, tree type,
|
||||
{
|
||||
// For pointer types, we are really only interested in asserting
|
||||
// whether the expression evaluates to non-NULL.
|
||||
if (!op1.zero_p () || !op2.zero_p ())
|
||||
if (!range_includes_zero_p (op1) || !range_includes_zero_p (op2))
|
||||
r.set_nonzero (type);
|
||||
else if (op1.zero_p () && op2.zero_p ())
|
||||
r.set_zero (type);
|
||||
|
Loading…
Reference in New Issue
Block a user