https://gcc.gnu.org/g:06d8257194444fd4b71c8e3d34fd9756be7f847b

commit r12-10619-g06d8257194444fd4b71c8e3d34fd9756be7f847b
Author: Stefan Schulze Frielinghaus <stefa...@gcc.gnu.org>
Date:   Tue Jul 16 14:01:50 2024 +0200

    s390: Align *cjump_64 and *icjump_64
    
    During machine reorg we optimize backward jumps and transform insns as
    e.g.
    
    (jump_insn 118 117 119 (set (pc)
            (if_then_else (ne (reg:CCRAW 33 %cc)
                    (const_int 8 [0x8]))
                (label_ref 134)
                (pc))) "dec_math_1.f90":204:8 discrim 1 2161 {*cjump_64}
         (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
            (int_list:REG_BR_PROB 719407028 (nil)))
     -> 134)
    
    into
    
    (jump_insn 118 117 432 (set (pc)
            (if_then_else (ne (reg:CCRAW 33 %cc)
                    (const_int 8 [0x8]))
                (pc)
                (label_ref 433))) "dec_math_1.f90":204:8 discrim 1 -1
         (expr_list:REG_DEAD (reg:CCRAW 33 %cc)
            (int_list:REG_BR_PROB 719407028 (nil)))
     -> 433)
    
    The latter is not recognized anymore since *icjump_64 only matches
    CC_REGNUM against zero.  Fixed by aligning *cjump_64 and *icjump_64.
    
    gcc/ChangeLog:
    
            * config/s390/s390.md (*icjump_64): Allow raw CC comparisons,
            i.e., any constant integer between 0 and 15 for CC comparisons.
    
    (cherry picked from commit 56de68aba6cb9cf3022d9e303eec6c6cdb49ad4d)

Diff:
---
 gcc/config/s390/s390.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index aaa247d7612f..5b174e0d866f 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -9472,7 +9472,8 @@
 (define_insn "*icjump_64"
   [(set (pc)
         (if_then_else
-          (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)])
+          (match_operator 1 "s390_comparison" [(reg CC_REGNUM)
+                                              (match_operand 2 
"const_int_operand" "")])
           (pc)
           (label_ref (match_operand 0 "" ""))))]
   ""

Reply via email to