https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103494
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Sandiford <rsand...@gcc.gnu.org>: https://gcc.gnu.org/g:7057b8f8c2fbb7a2112705c2962d92b8ccef7c30 commit r12-5632-g7057b8f8c2fbb7a2112705c2962d92b8ccef7c30 Author: Richard Sandiford <richard.sandif...@arm.com> Date: Tue Nov 30 17:32:36 2021 +0000 vect: Fix ncopies calculation for emulated gather/scatter [PR103494] I was too eager about removing ncopies calculations in g:10833849b55. When emulating gather/scatter, the offset ncopies can be different from the data ncopies. This patch restores the original calculation. gcc/ PR tree-optimization/103494 * tree-vect-stmts.c (vect_get_gather_scatter_ops): Remove ncopies argument and calculate ncopies from gs_info->offset_vectype where necessary. (vectorizable_store, vectorizable_load): Update accordingly. gcc/testsuite/ PR tree-optimization/103494 * gcc.dg/vect/pr103494.c: New test. * g++.dg/vect/pr103494.cc: Likewise.