This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/38012] vectorizer ignores 'restrict'



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]