This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/61938] Vectorization not happening .
- From: "harmeeksingh at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Jul 2014 22:24:55 +0000
- Subject: [Bug tree-optimization/61938] Vectorization not happening .
- Auto-submitted: auto-generated
- References: <bug-61938-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61938
--- Comment #6 from harmeeksingh at gmail dot com ---
Equivalent code when written by hand where tmp is a intermediate array . The
compiler
vectorizes both loops.
int k, i;
/* vectorize the compares */
for (i=0; i < arraysize; ++i) {
tmp[i] = (array[i] == compval);
}
/* another loop now set the result array */
for (k=0, i=0; i < arraysize; ++i) {
if (tmp[i])
{
result[k] = i;
k++;
}
}