https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97494
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- I guess this folding detail wasn't what the original testcase was supposed to test. Doing out[i*4] = (in[i*4] + 2) * 3; out[i*4 + 1] = (in[i*4 + 2] + 2) * 7; out[i*4 + 2] = (in[i*4 + 1] + 7) * 3; out[i*4 + 3] = (in[i*4 + 3] + 3) * 7; will fix that but then we still need some good target selector given likely not all targets can do this permute but we do not have "good" target-supports for specific permutes. Maybe /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_strided4 || vect_perm} && vect_int_mult } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && vect_int_mult } } } } */ will do though. I will try that. [it would be nice to have separate PRs for different test fails]