https://gcc.gnu.org/g:8284c03d8fa5b30ac85e04cbc7588b9563371772
commit r17-1778-g8284c03d8fa5b30ac85e04cbc7588b9563371772 Author: Robin Dapp <[email protected]> Date: Fri Apr 10 10:17:49 2026 +0200 vect: Do not use grouped gather for single pieces. Right now, we even use a grouped gather/scatter for single pieces, i.e. when there is no stride involved. This patch guards grouped gather with >= 2 pieces. gcc/ChangeLog: * tree-vect-stmts.cc (vect_use_grouped_gather): Only use when there are at least two pieces. Diff: --- gcc/tree-vect-stmts.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index e991e8615253..b69f9de5de82 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -1750,7 +1750,7 @@ vect_use_grouped_gather (dr_vec_info *dr_info, tree vectype, tree tmp; unsigned int pieces; if (!can_div_trunc_p (TYPE_VECTOR_SUBPARTS (vectype), nelts, &pieces) - || !pieces) + || pieces <= 1) return false; *pun_vectype = vector_vector_composition_type (vectype, pieces, &tmp, true);
