From: Lulu Cheng Date: Wed, 29 Oct 2025 01:21:58 +0000 (+0800) Subject: LoongArch: Fix ICE caused by loongarch_split_reduction [PR122477]. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f59cabadd0b678d744ba1f185ad215f561378a4e;p=thirdparty%2Fgcc.git LoongArch: Fix ICE caused by loongarch_split_reduction [PR122477]. In r16-4619, the scalar mode is not handled, which causes the compilation of test cases such as pr111414-1.c to fail in ICE. PR target/122477 gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_split_reduction): Added handling of scalar mode. --- diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index f7ce3aa2999..1dce56e46fd 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -4234,7 +4234,8 @@ loongarch_rtx_costs (rtx x, machine_mode mode, int outer_code, machine_mode loongarch_split_reduction (machine_mode mode) { - if (LSX_SUPPORTED_MODE_P (mode)) + if (!VECTOR_MODE_P (mode) + || LSX_SUPPORTED_MODE_P (mode)) return mode; return mode_for_vector (as_a (GET_MODE_INNER (mode)),