https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119275
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <l...@gcc.gnu.org>: https://gcc.gnu.org/g:44cd33881ff45ee7acc0ae1ddf154163d1eef924 commit r16-3206-g44cd33881ff45ee7acc0ae1ddf154163d1eef924 Author: Jeff Law <j...@ventanamicro.com> Date: Thu Aug 14 14:15:40 2025 -0600 [PR target/119275][RISC-V] Avoid calling gen_lowpart in cases where it would ICE So this is a minor bug in the riscv move expanders. It has a special cases for extraction from vector objects which makes assumptions that it can use gen_lowpart unconditionally. That's not always the case. We can just bypass that special code for cases where we can't use gen_lowpart and let the more generic code run. If gen_lowpart_common indicates we've got a case that can't be handled we just bypass the special extraction code. Tested on riscv64-elf and riscv32-elf. Waiting for pre-commit CI to do its thing. PR target/119275 gcc/ * config/riscv/riscv.cc (riscv_legitimize_move): Avoid calling gen_lowpart for cases where it'll fail. Just use standard expander paths for those cases. gcc/testsuite/ * gcc.target/riscv/pr119275.c: New test.