This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Mar 2011 10:08:52 +0000
- Subject: [Bug tree-optimization/48052] loop not vectorized if index is "unsigned int"
- Auto-submitted: auto-generated
- References: <bug-48052-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052
--- Comment #9 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2011-03-14 10:08:29 UTC ---
It is interesting to note that in case of fixed size (such as in these trivial
or template examples)
vectorization works also for unsigned int
void loop10( double const * __restrict__ x_in, double * __restrict__ x_out,
double const * __restrict__ c) {
for(unsigned int i=0; i!=10; ++i)
x_out[i] = c[i]*x_in[i];
}
template<typename T, unsigned int N>
void loopTu( T const * __restrict__ x_in, T * __restrict__ x_out, T const *
__restrict__ c) {
for(unsigned int i=0; i!=N; ++i)
x_out[i] = c[i]*x_in[i];
}
template<typename T, unsigned long long N>
void loopTull( T const * __restrict__ x_in, T * __restrict__ x_out, T const *
__restrict__ c) {
for(unsigned long long i=0; i!=N; ++i)
x_out[i] = c[i]*x_in[i];
}
void go(double const * __restrict__ x_in, double * __restrict__ x_out, double
const * __restrict__ c) {
loopTu<double,10>(x_in, x_out, c);
loopTull<double,10>(x_in, x_out, c);
}