https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94994
--- Comment #5 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:9fa5b473b5b8e289b6542adfd5cfaddfb3036048 commit r11-6380-g9fa5b473b5b8e289b6542adfd5cfaddfb3036048 Author: Richard Sandiford <richard.sandif...@arm.com> Date: Thu Dec 31 16:51:33 2020 +0000 vect: Fix bogus alignment assumption in alias checks [PR94994] This PR is about a case in which the vectoriser was feeding incorrect alignment information to tree-data-ref.c, leading to incorrect runtime alias checks. The alignment was taken from the TREE_TYPE of the DR_REF, which in this case was a COMPONENT_REF with a normally-aligned type. However, the underlying MEM_REF was only byte-aligned. This patch uses dr_alignment to calculate the (byte) alignment instead, just like we do when creating vector MEM_REFs. gcc/ PR tree-optimization/94994 * tree-vect-data-refs.c (vect_vfa_align): Use dr_alignment. gcc/testsuite/ PR tree-optimization/94994 * gcc.dg/vect/pr94994.c: New test.