https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121775
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Earnshaw <rearn...@gcc.gnu.org>: https://gcc.gnu.org/g:593e9ee05d683587c737df4fa7815a03f2c076c3 commit r16-3577-g593e9ee05d683587c737df4fa7815a03f2c076c3 Author: Richard Earnshaw <rearn...@arm.com> Date: Wed Sep 3 18:08:49 2025 +0100 arm: wrong code from vset_lane_* [PR121775] Insufficient validation of the operands in vec_set_<mode>_internal means that the optimizers can transform the exanded code into something that is invalid. We then emit code based on the incorrect RTL assuming that it is still valid. A valid pattern can only have a single bit set in the immediate operand, representing the lane to be written. gcc/ChangeLog: PR target/121775 * config/arm/neon.md (vec_set<mode>_internal, all variants): validate the immediate operand that indicates the lane to modify. gcc/testsuite/ChangeLog: PR target/121775 * gcc.target/arm/simd/vset_lane_u8.c: New test.