This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/38012] vectorizer ignores 'restrict'
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jun 2009 11:19:50 -0000
- Subject: [Bug middle-end/38012] vectorizer ignores 'restrict'
- References: <bug-38012-11859@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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