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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index 9fb0773d59e..fea0bb20ab1 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -4192,7 +4192,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 (!targetm.vector_mode_supported_p (mode)
+      || LSX_SUPPORTED_MODE_P (mode))
     return mode;
 
   return mode_for_vector (as_a <scalar_mode> (GET_MODE_INNER (mode)),
-- 
2.34.1

Reply via email to