public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Fix warning in predicated.md
@ 2023-06-02  3:04 juzhe.zhong
  2023-06-02  5:13 ` Kito Cheng
  2023-06-02  9:29 ` Andreas Schwab
  0 siblings, 2 replies; 6+ messages in thread
From: juzhe.zhong @ 2023-06-02  3:04 UTC (permalink / raw)
  To: gcc-patches
  Cc: kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw, rdapp.gcc,
	Juzhe-Zhong

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=all, Size: 1313 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 1ed84850e35..d14b1ca30bb 100644
--- a/gcc/config/riscv/predicates.md
+++ b/gcc/config/riscv/predicates.md
@@ -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")
-- 
2.36.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] RISC-V: Fix warning in predicated.md
  2023-06-02  3:04 [PATCH] RISC-V: Fix warning in predicated.md juzhe.zhong
@ 2023-06-02  5:13 ` Kito Cheng
  2023-06-02  6:12   ` Li, Pan2
  2023-06-02  9:29 ` Andreas Schwab
  1 sibling, 1 reply; 6+ messages in thread
From: Kito Cheng @ 2023-06-02  5:13 UTC (permalink / raw)
  To: 钟居哲
  Cc: GCC Patches, Kito Cheng, Palmer Dabbelt, Palmer Dabbelt,
	Jeff Law, Robin Dapp

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

Ok

<juzhe.zhong@rivai.ai> 於 2023年6月2日 週五 11:05 寫道:

> 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 1ed84850e35..d14b1ca30bb 100644
> --- a/gcc/config/riscv/predicates.md
> +++ b/gcc/config/riscv/predicates.md
> @@ -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")
> --
> 2.36.1
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] RISC-V: Fix warning in predicated.md
  2023-06-02  5:13 ` Kito Cheng
@ 2023-06-02  6:12   ` Li, Pan2
  0 siblings, 0 replies; 6+ messages in thread
From: Li, Pan2 @ 2023-06-02  6:12 UTC (permalink / raw)
  To: Kito Cheng, 钟居哲
  Cc: GCC Patches, Kito Cheng, Palmer Dabbelt, Palmer Dabbelt,
	Jeff Law, Robin Dapp

Committed, thanks Kito.

Pan

-----Original Message-----
From: Gcc-patches <gcc-patches-bounces+pan2.li=intel.com@gcc.gnu.org> On Behalf Of Kito Cheng via Gcc-patches
Sent: Friday, June 2, 2023 1:13 PM
To: 钟居哲 <juzhe.zhong@rivai.ai>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Kito Cheng <kito.cheng@gmail.com>; Palmer Dabbelt <palmer@dabbelt.com>; Palmer Dabbelt <palmer@rivosinc.com>; Jeff Law <jeffreyalaw@gmail.com>; Robin Dapp <rdapp.gcc@gmail.com>
Subject: Re: [PATCH] RISC-V: Fix warning in predicated.md

Ok

<juzhe.zhong@rivai.ai> 於 2023年6月2日 週五 11:05 寫道:

> 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 1ed84850e35..d14b1ca30bb 100644
> --- a/gcc/config/riscv/predicates.md
> +++ b/gcc/config/riscv/predicates.md
> @@ -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")
> --
> 2.36.1
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] RISC-V: Fix warning in predicated.md
  2023-06-02  3:04 [PATCH] RISC-V: Fix warning in predicated.md juzhe.zhong
  2023-06-02  5:13 ` Kito Cheng
@ 2023-06-02  9:29 ` Andreas Schwab
  2023-06-02  9:31   ` juzhe.zhong
  2023-06-02  9:35   ` juzhe.zhong
  1 sibling, 2 replies; 6+ messages in thread
From: Andreas Schwab @ 2023-06-02  9:29 UTC (permalink / raw)
  To: juzhe.zhong
  Cc: gcc-patches, kito.cheng, kito.cheng, palmer, palmer, jeffreyalaw,
	rdapp.gcc

../../gcc/gcc/config/riscv/predicates.md: In function ‘bool arith_operand_or_mod
e_mask(rtx, machine_mode)’:
../../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)

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] RISC-V: Fix warning in predicated.md
  2023-06-02  9:29 ` Andreas Schwab
@ 2023-06-02  9:31   ` juzhe.zhong
  2023-06-02  9:35   ` juzhe.zhong
  1 sibling, 0 replies; 6+ messages in thread
From: juzhe.zhong @ 2023-06-02  9:31 UTC (permalink / raw)
  To: schwab
  Cc: gcc-patches, kito.cheng, Kito.cheng, palmer, palmer, jeffreyalaw,
	Robin Dapp

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

Oh there is 2 INTVAL (op) == GET_MODE_MASK...
I only change one .... :)



juzhe.zhong@rivai.ai
 
From: Andreas Schwab
Date: 2023-06-02 17:29
To: juzhe.zhong
CC: gcc-patches; kito.cheng; kito.cheng; palmer; palmer; jeffreyalaw; rdapp.gcc
Subject: Re: [PATCH] RISC-V: Fix warning in predicated.md
../../gcc/gcc/config/riscv/predicates.md: In function ‘bool arith_operand_or_mod
e_mask(rtx, machine_mode)’:
../../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)
 
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] RISC-V: Fix warning in predicated.md
  2023-06-02  9:29 ` Andreas Schwab
  2023-06-02  9:31   ` juzhe.zhong
@ 2023-06-02  9:35   ` juzhe.zhong
  1 sibling, 0 replies; 6+ messages in thread
From: juzhe.zhong @ 2023-06-02  9:35 UTC (permalink / raw)
  To: schwab
  Cc: gcc-patches, kito.cheng, Kito.cheng, palmer, palmer, jeffreyalaw,
	Robin Dapp

[-- Attachment #1: Type: text/plain, Size: 842 bytes --]

Hi, I fixed it :
https://gcc.gnu.org/pipermail/gcc-patches/2023-June/620462.html 
Just feel free to commit it.

Thanks.


juzhe.zhong@rivai.ai
 
From: Andreas Schwab
Date: 2023-06-02 17:29
To: juzhe.zhong
CC: gcc-patches; kito.cheng; kito.cheng; palmer; palmer; jeffreyalaw; rdapp.gcc
Subject: Re: [PATCH] RISC-V: Fix warning in predicated.md
../../gcc/gcc/config/riscv/predicates.md: In function ‘bool arith_operand_or_mod
e_mask(rtx, machine_mode)’:
../../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)
 
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-02  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  3:04 [PATCH] RISC-V: Fix warning in predicated.md juzhe.zhong
2023-06-02  5:13 ` Kito Cheng
2023-06-02  6:12   ` Li, Pan2
2023-06-02  9:29 ` Andreas Schwab
2023-06-02  9:31   ` juzhe.zhong
2023-06-02  9:35   ` juzhe.zhong

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).