https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115385
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:6669dc51515313dd1e60c493596dbc90429fc362 commit r15-1239-g6669dc51515313dd1e60c493596dbc90429fc362 Author: Richard Biener <rguent...@suse.de> Date: Fri Jun 7 14:47:12 2024 +0200 tree-optimization/115385 - handle more gaps with peeling of a single iteration The following makes peeling of a single scalar iteration handle more gaps, including non-power-of-two cases. This can be done by rounding up the remaining access to the next power-of-two which ensures that the next scalar iteration will pick at least the number of excess elements we access. I've added a correctness testcase and one x86 specific scanning for the optimization. PR tree-optimization/115385 * tree-vect-stmts.cc (get_group_load_store_type): Peeling of a single scalar iteration is sufficient if we can narrow the access to the next power of two of the bits in the last access. (vectorizable_load): Ensure that the last access is narrowed. * gcc.dg/vect/pr115385.c: New testcase. * gcc.target/i386/vect-pr115385.c: Likewise.