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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amacleod at redhat dot com

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I bet to solve this on the ranger side rather than threader, we'd need to
determine that
  # RANGE [0, 5] NONZERO 5
  f_21 = _29 * 5;
  # RANGE [0, 5] NONZERO 5
  _25 = (int) f_21;
  # RANGE [0, 5] NONZERO 5
  k_15 = (unsigned int) f_21;
  # RANGE [0, 5] NONZERO 7
  _9 = _25 >> k_15;
on the right shift _25 and k_15 are actually equivalent (yes, they have
different types, but given the known ranges for it the casts don't really
matter for the value), make sure that the fact that rhs1 is equal to rhs2 is
told to the handler and special case the shift.  Either if we know the range is
[0, 0] U [5, 5] and operands equal, then it is 0 >> 0 or 5 >> 5, both 0, or for
[0, 5] it is 0 >> 0, 1 >> 1, 2 >> 2, 3 >> 3, 4 >> 4 or 5 >> 5, all of which are
also [0, 0].  For shifts we know only a handful of shift counts are valid and
we can try them all and compute the range as union of results for each possible
value.

Reply via email to