https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118950
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Robin Dapp <rd...@gcc.gnu.org>: https://gcc.gnu.org/g:f3d4208e798afafcba5246334004e9646e390681 commit r15-7687-gf3d4208e798afafcba5246334004e9646e390681 Author: Robin Dapp <rd...@ventanamicro.com> Date: Fri Feb 21 07:19:40 2025 +0100 vect: Use original LHS type for gather pattern [PR118950]. In PR118950 we do not zero masked elements in a gather load. While recognizing a gather/scatter pattern we do not use the original type of the LHS. This matters because the type can differ with bool patterns (e.g. _Bool vs unsigned char) and we don't notice the need for zeroing out the padding bytes. This patch just uses the original LHS's type. PR middle-end/118950 gcc/ChangeLog: * tree-vect-patterns.cc (vect_recog_gather_scatter_pattern): Use original LHS's type. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr118950.c: New test.