https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92526
--- Comment #2 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Thu Nov 21 17:45:36 2019 New Revision: 278592 URL: https://gcc.gnu.org/viewcvs?rev=278592&root=gcc&view=rev Log: Reject versioning for alignment with different masks (PR 92526) Allowing mixed vector sizes broke the assumption in the following assert, since it's now possible for different accesses to require different levels of alignment: /* FORNOW: use the same mask to test all potentially unaligned references in the loop. The vectorizer currently supports a single vector size, see the reference to GET_MODE_NUNITS (TYPE_MODE (vectype)) where the vectorization factor is computed. */ gcc_assert (!LOOP_VINFO_PTR_MASK (loop_vinfo) || LOOP_VINFO_PTR_MASK (loop_vinfo) == mask); I guess we could try to over-align smaller accesses so that all of them are consistent, or try to support multiple alignment masks, but for now the easiest fix seems to be to turn the assert into a bail-out check. 2019-11-21 Richard Sandiford <richard.sandif...@arm.com> gcc/ PR tree-optimization/92526 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Reject versioning for alignment if the accesses do not have a consistent mask, rather than asserting that the masks are consistent. gcc/testsuite/ PR tree-optimization/92526 * gcc.target/aarch64/pr92526.c: New test. Added: trunk/gcc/testsuite/gcc.target/aarch64/pr92526.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-data-refs.c