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

Andrew Macleod <amacleod at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com
             Status|NEW                         |ASSIGNED

--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
The algorithm for bitwise AND predates ranger and multiple subranges so it
tends to give up when it is presented with complex signed operations.  In this
case, it simply returned VARYING and we can go no further.

Mostly the issue seems to be when a range contains both signed and unsigned
values, so we can adjust operator_bitwise_and::wi_fold to recognize when the
subrange crosses the sign barrier, and split
  [lb, ub]
into
  [lb, -1]  and   [0, ub]
for processing, then combine the results. 

Patch in testing

Reply via email to