This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/60505] New: Warning caused by GCC vectorizer.
- From: "congh at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 11 Mar 2014 22:00:55 +0000
- Subject: [Bug tree-optimization/60505] New: Warning caused by GCC vectorizer.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60505
Bug ID: 60505
Summary: Warning caused by GCC vectorizer.
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: congh at google dot com
The compilation on the code below fails with options "-Wall -Werror -O2
-ftree-loop-vectorize". The reason is that the epilogue generated by the
vectorizer tries to access the memory outside of ovec[16] and the the vrp pass
emits the warning "array subscript is above array bounds" for the access to
ovec[i]. The vectorizer should not generate the epilogue for this loop.
void foo(char *in, char *out, int num)
{
int i;
unsigned char ovec[16] = {0};
for(i=0; i < num ; ++i)
out[i] = (ovec[i] = in[i]);
out[num] = ovec[num/2];
}