https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119103
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org --- Comment #15 from Alexander Monakov <amonakov at gcc dot gnu.org> --- (In reply to Niklas Haas from comment #12) > Out of curiosity, is there a work-around that I could use to get current > versions of GCC to compile the right thing, but without breaking > cross-platform compatibility? > > I did try replacing the assertion by "x[i] << (amount & 0xF)" but the vector > version of the code at least still compiles down to vpslld. This quote seems apropos: "autovectorization is not a programming model". Not sure if you know that already, but with generic vectors you can write: typedef uint16_t u16v16 __attribute__((vector_size(32))); typedef u16v16 u16v16_u __attribute__((aligned(2))); void lshift_register(u16v16_u *x, uint8_t amount) { *x <<= amount; }