https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113572
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Richard Sandiford <rsand...@gcc.gnu.org>: https://gcc.gnu.org/g:c3de14ba1ba0e77254118af64ed881f115ee42a0 commit r14-8422-gc3de14ba1ba0e77254118af64ed881f115ee42a0 Author: Richard Sandiford <richard.sandif...@arm.com> Date: Thu Jan 25 12:03:18 2024 +0000 aarch64: Fix out-of-bounds ENCODED_ELT access [PR113572] When generalising vector_cst_all_same, I'd forgotten to update VECTOR_CST_ENCODED_ELT to VECTOR_CST_ELT. The check deliberately looks at implicitly encoded elements in some cases. gcc/ PR target/113572 * config/aarch64/aarch64-sve-builtins.cc (vector_cst_all_same): Check VECTOR_CST_ELT instead of VECTOR_CST_ENCODED_ELT gcc/testsuite/ PR target/113572 * gcc.target/aarch64/sve/pr113572.c: New test.