https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112855
--- Comment #2 from GCC 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:c9d5b46a25547035e381b0246de5cb553ca8b02d commit r14-6222-gc9d5b46a25547035e381b0246de5cb553ca8b02d Author: Juzhe-Zhong <juzhe.zh...@rivai.ai> Date: Wed Dec 6 22:26:46 2023 +0800 RISC-V: Fix VSETVL PASS bug As PR112855 mentioned, the VSETVL PASS insert vsetvli in unexpected location. Due to 2 reasons: 1. incorrect transparant computation LCM data. We need to check VL operand defs and uses. 2. incorrect fusion of unrelated edge which is the edge never reach the vsetvl expression. PR target/112855 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pre_vsetvl::compute_lcm_local_properties): Fix transparant LCM data. (pre_vsetvl::earliest_fuse_vsetvl_info): Disable earliest fusion for unrelated edge. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr112855.c: New test.