Consider the following test compiled with r130351 on ppc64-linux: #define M 10 #define N 3
void foo (int n, int *ub, int *uc) { int i, j, tmp1; for (i = 0; i < n; i++) { tmp1 = 0; for (j = 0; j < M; j++) { tmp1 += uc[i] * ((int)(j << N) / M); } ub[i] = tmp1; } } Here is a snippet from the vectorizer dump: c.c:12: note: not vectorized: relevant stmt not supported: D.1652_13 = j_29 << 3 c.c:12: note: bad operation or unsupported loop bound. [Adding a complete unrolling + ccp passes before the vectorizer can help to vectorize the outer loop] -- Summary: missed optimization - complete unrolling pass before the vectorizer Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: eres at il dot ibm dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34223