[Bug tree-optimization/61247] vectorization fails for unsigned is used for IV but casted to int before using as the index (and then casted for internal type)

sje at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 25 19:23:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61247

--- Comment #4 from Steve Ellcey <sje at gcc dot gnu.org> ---
Here is a simpler C version of the problem.

On aarch64 in LP64 mode setting TYPE
to int, long int, or unsigned long int allows for vectorization
but using unsigned int does not get vectorized.

In ILP32 mode, all types allow the loop to be vectorized.


/* int gets vectorized
   long int gets vectorized
   unsigned long int gets vectorized
   unsigned int does NOT get vectorized in LP64 mode */

typedef unsigned int TYPE;
void f(TYPE N, int *C, int *A, int val)
{
        TYPE i,j;
        for (i=0; i<N; i++) {
                for (j=0; j<N; j++) {
                        C[i*N+j]=A[i*N+j] * val;
                }
        }
}


More information about the Gcc-bugs mailing list