* [PATCH V2] RISC-V: Fix warning in predicated.md
@ 2023-06-02 9:33 juzhe.zhong
2023-06-02 20:57 ` Jeff Law
0 siblings, 1 reply; 3+ messages in thread
From: juzhe.zhong @ 2023-06-02 9:33 UTC (permalink / raw)
To: gcc-patches
Cc: kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw, rdapp.gcc,
schwab, Juzhe-Zhong
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1351 bytes --]
From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md
index d14b1ca30bb..04ca6ceabc7 100644
--- a/gcc/config/riscv/predicates.md
+++ b/gcc/config/riscv/predicates.md
@@ -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"
--
2.36.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V2] RISC-V: Fix warning in predicated.md
2023-06-02 9:33 [PATCH V2] RISC-V: Fix warning in predicated.md juzhe.zhong
@ 2023-06-02 20:57 ` Jeff Law
2023-06-03 2:33 ` Li, Pan2
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2023-06-02 20:57 UTC (permalink / raw)
To: juzhe.zhong, gcc-patches
Cc: kito.cheng, kito.cheng, palmer, palmer, rdapp.gcc, schwab
On 6/2/23 03:33, juzhe.zhong@rivai.ai wrote:
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md
> index d14b1ca30bb..04ca6ceabc7 100644
> --- a/gcc/config/riscv/predicates.md
> +++ b/gcc/config/riscv/predicates.md
> @@ -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)"))))
OK.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH V2] RISC-V: Fix warning in predicated.md
2023-06-02 20:57 ` Jeff Law
@ 2023-06-03 2:33 ` Li, Pan2
0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-06-03 2:33 UTC (permalink / raw)
To: Jeff Law, juzhe.zhong, gcc-patches
Cc: kito.cheng, kito.cheng, palmer, palmer, rdapp.gcc, schwab
Committed, thanks Jeff.
Pan
-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Jeff Law via Gcc-patches
Sent: Saturday, June 3, 2023 4:57 AM
To: juzhe.zhong@rivai.ai; gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com; kito.cheng@sifive.com; palmer@dabbelt.com; palmer@rivosinc.com; rdapp.gcc@gmail.com; schwab@linux-m68k.org
Subject: Re: [PATCH V2] RISC-V: Fix warning in predicated.md
On 6/2/23 03:33, juzhe.zhong@rivai.ai wrote:
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/config/riscv/predicates.md
> b/gcc/config/riscv/predicates.md index d14b1ca30bb..04ca6ceabc7 100644
> --- a/gcc/config/riscv/predicates.md
> +++ b/gcc/config/riscv/predicates.md
> @@ -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)"))))
OK.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-03 2:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 9:33 [PATCH V2] RISC-V: Fix warning in predicated.md juzhe.zhong
2023-06-02 20:57 ` Jeff Law
2023-06-03 2:33 ` Li, Pan2
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).