https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112598
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Pan Li <pa...@gcc.gnu.org>: https://gcc.gnu.org/g:de6f3e12bd188fee30bc79a5e323e16e0dbbe8ca commit r14-5755-gde6f3e12bd188fee30bc79a5e323e16e0dbbe8ca Author: Juzhe-Zhong <juzhe.zh...@rivai.ai> Date: Wed Nov 22 18:53:22 2023 +0800 RISC-V: Fix incorrect use of vcompress in permutation auto-vectorization This patch fixes following FAILs on zvl512b of RV32 system: FAIL: gcc.target/riscv/rvv/autovec/struct/struct_vect_run-12.c execution test FAIL: gcc.target/riscv/rvv/autovec/struct/struct_vect_run-9.c execution test The root cause is that for permutation indice = {0,3,7,0} use vcompress optimization which is incorrect. Fix vcompress optimization bug. PR target/112598 gcc/ChangeLog: * config/riscv/riscv-v.cc (shuffle_compress_patterns): Fix vcompress bug. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr112598-3.c: New test.