[Bug middle-end/38012] vectorizer ignores 'restrict'
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Jun 25 11:20:00 GMT 2009
------- 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
More information about the Gcc-bugs
mailing list