]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
C-SKY: Fix missing operand when do spilt for cskyv2_addcc and cskyv2_addcc_invert.
authorXianmiao Qu <cooper.qu@linux.alibaba.com>
Tue, 6 Sep 2022 07:10:36 +0000 (15:10 +0800)
committerXianmiao Qu <cooper.qu@linux.alibaba.com>
Tue, 6 Sep 2022 07:13:21 +0000 (15:13 +0800)
It will cause ICE when compiling the case:
gcc/testsuite/gcc.dg/params/blocksort-part.c

gcc/
* config/csky/csky.md (cskyv2_addcc): Fix missing operand.
(cskyv2_addcc_invert): Likewise.

gcc/config/csky/csky.md

index 6b05930a9fbaa2fa90ab4ed1c8a5cbc47aed69e0..6a6592902ef2da437ad8b4b63262bb8a01f92560 100644 (file)
   "reload_completed && !rtx_equal_p (operands[0], operands[1])"
   [(set (match_dup 0)
        (if_then_else:SI (ne (reg:CC CSKY_CC_REGNUM) (const_int 0))
-                        (plus:SI (match_dup 0) (match_dup 2))))]
+                        (plus:SI (match_dup 0) (match_dup 2))
+                        (match_dup 0)))]
   {
     emit_insn (gen_movf (copy_rtx (operands[0]),
                         copy_rtx (operands[1]),
   "reload_completed && !rtx_equal_p (operands[0], operands[1])"
   [(set (match_dup 0)
        (if_then_else:SI (eq (reg:CC CSKY_CC_REGNUM) (const_int 0))
-                        (plus:SI (match_dup 0) (match_dup 2))))]
+                        (plus:SI (match_dup 0) (match_dup 2))
+                        (match_dup 0)))]
   {
     emit_insn (gen_movt (copy_rtx (operands[0]),
                         copy_rtx (operands[1]),