public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc
@ 2023-06-16 11:35 pan2.li
  2023-06-16 11:40 ` Robin Dapp
  0 siblings, 1 reply; 3+ messages in thread
From: pan2.li @ 2023-06-16 11:35 UTC (permalink / raw)
  To: gcc-patches
  Cc: juzhe.zhong, rdapp.gcc, jeffreyalaw, pan2.li, yanzhang.wang, kito.cheng

From: Pan Li <pan2.li@intel.com>

This patch would like to fix one maybe-uninitialized warning. Aka:

riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: Pan Li <pan2.li@intel.com>

gcc/ChangeLog:

	* config/riscv/riscv-vsetvl.cc
	(pass_vsetvl::global_eliminate_vsetvl_insn): Initialize var by NULL.
---
 gcc/config/riscv/riscv-vsetvl.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index cae9be0d928..7066dea3d14 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -4340,7 +4340,7 @@ get_first_vsetvl_before_rvv_insns (basic_block cfg_bb)
 bool
 pass_vsetvl::global_eliminate_vsetvl_insn (const bb_info *bb) const
 {
-  rtx_insn *vsetvl_rinsn;
+  rtx_insn *vsetvl_rinsn = NULL;
   vector_insn_info dem = vector_insn_info ();
   const auto &block_info = get_block_info (bb);
   basic_block cfg_bb = bb->cfg_bb ();
-- 
2.34.1


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

* Re: [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc
  2023-06-16 11:35 [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc pan2.li
@ 2023-06-16 11:40 ` Robin Dapp
  2023-06-16 11:49   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Dapp @ 2023-06-16 11:40 UTC (permalink / raw)
  To: pan2.li, gcc-patches
  Cc: rdapp.gcc, juzhe.zhong, jeffreyalaw, yanzhang.wang, kito.cheng

> This patch would like to fix one maybe-uninitialized warning. Aka:
> 
> riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized]
> 
> Signed-off-by: Pan Li <pan2.li@intel.com>

IMHO obvious enough that it doesn't need a maintainer's OK, so go
ahead.

We should make sure to find such nits before Andreas does in the
future, though, as we don't want to waste his time.
This means either proper bootstrapping or always configuring
with -Werror=all (or similar).  The latter should catch most and
is less intrusive.

Regards
 Robin


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

* RE: [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc
  2023-06-16 11:40 ` Robin Dapp
@ 2023-06-16 11:49   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2023-06-16 11:49 UTC (permalink / raw)
  To: Robin Dapp, gcc-patches
  Cc: juzhe.zhong, jeffreyalaw, Wang, Yanzhang, kito.cheng

Committed, thanks Robin.

Pan

-----Original Message-----
From: Robin Dapp <rdapp.gcc@gmail.com> 
Sent: Friday, June 16, 2023 7:41 PM
To: Li, Pan2 <pan2.li@intel.com>; gcc-patches@gcc.gnu.org
Cc: rdapp.gcc@gmail.com; juzhe.zhong@rivai.ai; jeffreyalaw@gmail.com; Wang, Yanzhang <yanzhang.wang@intel.com>; kito.cheng@gmail.com
Subject: Re: [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc

> This patch would like to fix one maybe-uninitialized warning. Aka:
> 
> riscv-vsetvl.cc:4354:3: error: 'vsetvl_rinsn' may be used uninitialized [-Werror=maybe-uninitialized]
> 
> Signed-off-by: Pan Li <pan2.li@intel.com>

IMHO obvious enough that it doesn't need a maintainer's OK, so go
ahead.

We should make sure to find such nits before Andreas does in the
future, though, as we don't want to waste his time.
This means either proper bootstrapping or always configuring
with -Werror=all (or similar).  The latter should catch most and
is less intrusive.

Regards
 Robin


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

end of thread, other threads:[~2023-06-16 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 11:35 [PATCH v1] RISC-V: Fix one warning of maybe-uninitialized in riscv-vsetvl.cc pan2.li
2023-06-16 11:40 ` Robin Dapp
2023-06-16 11:49   ` 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).