https://gcc.gnu.org/g:f59cabadd0b678d744ba1f185ad215f561378a4e

commit r16-4943-gf59cabadd0b678d744ba1f185ad215f561378a4e
Author: Lulu Cheng <[email protected]>
Date:   Wed Oct 29 09:21:58 2025 +0800

    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:
---
 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 f7ce3aa2999a..1dce56e46fd1 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 <scalar_mode> (GET_MODE_INNER (mode)),

Reply via email to