]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Fix warning in predicated.md
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Fri, 2 Jun 2023 09:33:33 +0000 (17:33 +0800)
committerPan Li <pan2.li@intel.com>
Sat, 3 Jun 2023 02:33:07 +0000 (10:33 +0800)
Notice there is warning in predicates.md:
../../../riscv-gcc/gcc/config/riscv/predicates.md: In function â€˜bool arith_operand_or_mode_mask(rtx, machine_mode)’:
../../../riscv-gcc/gcc/config/riscv/predicates.md:33:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             (match_test "INTVAL (op) == GET_MODE_MASK (HImode)
../../../riscv-gcc/gcc/config/riscv/predicates.md:34:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     || INTVAL (op) == GET_MODE_MASK (SImode)"))))

gcc/ChangeLog:

* config/riscv/predicates.md: Change INTVAL into UINTVAL.

gcc/config/riscv/predicates.md

index d14b1ca30bb0e25b0b597b42dd272f20f99b1f8f..04ca6ceabc71f93f2ffe303b1d7f93d442bc60ec 100644 (file)
@@ -30,7 +30,7 @@
 (define_predicate "arith_operand_or_mode_mask"
   (ior (match_operand 0 "arith_operand")
        (and (match_code "const_int")
-            (match_test "INTVAL (op) == GET_MODE_MASK (HImode)
+            (match_test "UINTVAL (op) == GET_MODE_MASK (HImode)
                         || UINTVAL (op) == GET_MODE_MASK (SImode)"))))
 
 (define_predicate "lui_operand"