https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63665
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Latent issue. pr45752.c:40:3: note: Load permutation 2 2 2 2 2 3 3 3 3 3 0 0 0 0 0 1 1 1 1 1 4 4 4 4 4 We have a SLP group size of 5 and computed an unroll factor of 2 (ok). It looks to me that Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c (revision 216771) +++ gcc/tree-vect-slp.c (working copy) @@ -3041,6 +3041,7 @@ vect_transform_slp_perm_load (slp_tree n &number_of_mask_fixes, &mask_fixed, &needs_first_vector)) return false; + gcc_assert (current_mask_element < 2 * nunits); mask[index++] = current_mask_element; if (index == nunits) makes x86_64 ICE as well. The issue is that we suddenly need to skip _two_ vectors in vect_get_mask_element which isn't implemented so we get out-of-bound indexes. Seems we need to iterate instead in which case we will reject vectorization correctly with pr45752.c:40:3: note: Load permutation 2 2 2 2 2 3 3 3 3 3 0 0 0 0 0 1 1 1 1 1 4 4 4 4 4 pr45752.c:40:3: note: permutation requires at least three vectors c_71 = MEM[(unsigned int *)pInput2_135 + 8B]; pr45752.c:40:3: note: Build SLP failed: unsupported load permutation *pOutput2_136 = _83;