https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119275
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:e4f492106bf25a9b1376f9cf5f29cf88c5633334 commit r15-10514-ge4f492106bf25a9b1376f9cf5f29cf88c5633334 Author: Jeff Law <[email protected]> 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. (cherry picked from commit 44cd33881ff45ee7acc0ae1ddf154163d1eef924)
