This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds"
- From: "izamyatin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Jan 2015 15:01:46 +0000
- Subject: [Bug tree-optimization/64277] [4.9/5 Regression] Incorrect warning "array subscript is above array bounds"
- Auto-submitted: auto-generated
- References: <bug-64277-4 at http dot gcc dot gnu dot org/bugzilla/>
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>;