https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40073
--- Comment #16 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
Going from gcc 8.2 to gcc 9.1, I find the following two test cases are now
autovectorized:
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* Test auto-vectorization */
#include "vector-types.h"
#define LENGTH 256
__attribute__((aligned (VECTOR_SIZE))) short a[LENGTH], b[LENGTH];
short c;
void foo (void) {
int i;
for (i=0; i<LENGTH; i++){
a[i] = b[i] >> (c & 0xf);
}
}
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* Test auto-vectorization */
#include "vector-types.h"
#define LENGTH 256
__attribute__((aligned (VECTOR_SIZE))) unsigned short a[LENGTH], b[LENGTH];
unsigned short c;
void foo (void) {
int i;
for (i=0; i<LENGTH; i++){
a[i] = b[i] >> (c & 0xf);
}
}