https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61247
Bug ID: 61247
Summary: vectorization fails if conversion from unsigned int to
signed int is involved
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vincenzo.innocente at cern dot ch
in the following example
cat uintLoop.cc
unsigned int N;
float * a, *b, *c;
using Ind = /*unsigned*/ int;
inline
float & val(float * x, Ind i) { return x[i];}
inline
float const & val(float const * x, Ind i) { return x[i];}
void foo() {
#pragma GCC ivdep
for (auto i=0U; i<N; ++i)
val(a,i) = val(b,i)*val(c,i);
}
using Ind = /*unsigned*/ int;
does not vectorize with
c++ -std=c++1y -Ofast -Wall -fopt-info-vec-missed -fno-tree-slp-vectorize
-march=nehalem -S uintLoop.cc
uintLoop.cc:12:17: note: not vectorized: not suitable for gather load _8 =
*_17;
uintLoop.cc:12:17: note: bad data references.
using Ind = unsigned int;
vectorize fine
minor, just annoying