]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Fix ICE caused by loongarch_split_reduction [PR122477].
authorLulu Cheng <chenglulu@loongson.cn>
Wed, 29 Oct 2025 01:21:58 +0000 (09:21 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 3 Nov 2025 01:48:50 +0000 (09:48 +0800)
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.

gcc/config/loongarch/loongarch.cc

index f7ce3aa2999aa60a42a870fa27911bb9471cff7c..1dce56e46fd17daabf98d43d73b1dc0fe134fe4e 100644 (file)
@@ -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 <scalar_mode> (GET_MODE_INNER (mode)),