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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 2nd issue is blacksq.size () might be > UINT_MAX.  Using 'int' for i or
using i < (unsigned int)blacksq.size() avoids this.  So we can vectorize
the following, side-stepping both issues.  The IV issue should have worked
by niter assumptions (but I don't see those - huh) and marking IVs as
non-wrapping.

Analyzing # of iterations of loop 1
  exit condition [1, + , 1] < (long unsigned int) __dif_33
  bounds on difference of bases: -1 ... 18446744073709551614
  result:
    zero if __dif_33 == 0
    # of iterations (long unsigned int) __dif_33 + 18446744073709551615,
bounded by 18446744073709551614


#include <vector>

size_t s;
void fun(std::vector<int>& blacksq, std::vector<int>& m_mcowner)
{
  s = m_mcowner.size ();
  for (unsigned int i = 0; i < (unsigned int)blacksq.size(); i++) {
      if (blacksq[i]) {
          m_mcowner[i]++;
      }
  }
}

Reply via email to