void vector_add(int n,
                double * __restrict__ r,
                double * __restrict__ a,
                double * __restrict__ b) {
  int i;
  for(i=0; i<n; i++) {
    r[i] = a[i] + b[i];
  }
}

gets vectorized.

If i is of type 'unsigned int', the loop does not get vectorized.


-- 
           Summary: unsigned int loop indices are not accepted by the
                    vectorizer
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: David dot Monniaux at ens dot fr
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25881

Reply via email to