This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds"


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

--- Comment #6 from Igor Zamyatin <izamyatin at gmail dot com> ---
cunroll phase 7 times completely unrolls post-loop that was generated by
vectorizer.

And later vrp complains on those unrolled iterations.

Note that for the test without if (nc > 3), i.e.

void foo(short a[], short m)
{
  int i,j;
  int f1[10];
  short nc;

  nc = m + 1;
  for (i = 0, j = m; i < nc; i++, j--)
    {
      a[i] = f1[i];
      a[j] = i;
    }
  return;
}

vrp doesn't complain while cunroll still performs 7 times complete unroll.

Most probably merge block generated for the original testcase affects vrp's
work:

  <bb 14>:
  # prephitmp_39 = PHI <pretmp_40(3), _450(13), _451(40)>
  j_18 = (int) m_7(D);
  if (prephitmp_39 > 0)
    goto <bb 16>;
  else
    goto <bb 15>;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]