https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121542
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by LuluCheng <chengl...@gcc.gnu.org>: https://gcc.gnu.org/g:27d6b600b1e5c0e0eccb41d957ef453c4f347e8d commit r15-10235-g27d6b600b1e5c0e0eccb41d957ef453c4f347e8d Author: Lulu Cheng <chengl...@loongson.cn> Date: Thu Aug 14 11:59:53 2025 +0800 LoongArch: Fix ICE caused by function add_stmt_cost[PR121542]. PR target/121542 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_vector_costs::add_stmt_cost): When using vectype, first determine whether it is NULL. gcc/testsuite/ChangeLog: * gcc.target/loongarch/pr121542.c: New test. (cherry picked from commit d1c207a65d25b50e851ab53956271c91e0281ae0)