https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115843
--- Comment #18 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:06829e593d2e5611e7924624cb8228795691e2b7 commit r14-10439-g06829e593d2e5611e7924624cb8228795691e2b7 Author: Richard Biener <rguent...@suse.de> Date: Mon Jul 15 13:50:58 2024 +0200 tree-optimization/115843 - fix wrong-code with fully-masked loop and peeling When AVX512 uses a fully masked loop and peeling we fail to create the correct initial loop mask when the mask is composed of multiple components in some cases. The following fixes this by properly applying the bias for the component to the shift amount. PR tree-optimization/115843 * tree-vect-loop-manip.cc (vect_set_loop_condition_partial_vectors_avx512): Properly bias the shift of the initial mask for alignment peeling. * gcc.dg/vect/pr115843.c: New testcase. (cherry picked from commit a177be05f6952c3f7e62186d2e138d96c475b81a)