------- Comment #3 from rguenth at gcc dot gnu dot org 2009-06-25 11:19 ------- double* __restrict__ va; const double* __restrict__ vb; for(unsigned i=0; i<a.size(); i++) { va = &a[i]; vb = &b[i]; (*va) = (*vb) *coef; }
this only says that a[i] and b[i] do not alias in one loop iteration, it doesn't cover cross-iteration dependencies that the vectorizer needs. double* __restrict__ va = a; const double* __restrict__ vb = b; for(unsigned i=0; i<a.size(); i++) { va[i] = vb[i] *coef; } will work. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38012