]> 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 03:04:43 +0000 (11:04 +0800)
committerPan Li <pan2.li@intel.com>
Fri, 2 Jun 2023 06:10:40 +0000 (14:10 +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 1ed84850e351590c7a8ef05601baa5ce9d133901..d14b1ca30bb0e25b0b597b42dd272f20f99b1f8f 100644 (file)
@@ -31,7 +31,7 @@
   (ior (match_operand 0 "arith_operand")
        (and (match_code "const_int")
             (match_test "INTVAL (op) == GET_MODE_MASK (HImode)
-                        || INTVAL (op) == GET_MODE_MASK (SImode)"))))
+                        || UINTVAL (op) == GET_MODE_MASK (SImode)"))))
 
 (define_predicate "lui_operand"
   (and (match_code "const_int")