public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] vect: Initialize new_temp to avoid false positive warning [PR110652]
@ 2023-07-17  2:22 Kewen.Lin
  2023-07-17  6:39 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Kewen.Lin @ 2023-07-17  2:22 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener

Hi,

As PR110652 and its duplicate PRs show, there could be one
build error

  error: 'new_temp' may be used uninitialized

for some build configurations.  It's a false positive warning
(or error at -Werror), but in order to make the build succeed,
this patch is to initialize the reported variable 'new_temp'
as NULL_TREE.

Confirmed this patch fixed the reported issue in PR110652
(with the same configuration).

Is it ok for trunk?

BR,
Kewen
-----
	PR tree-optimization/110652

gcc/ChangeLog:

	* tree-vect-stmts.cc (vectorizable_load): Initialize new_temp as
	NULL_TREE.
---
 gcc/tree-vect-stmts.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index c08d0ef951f..cb86d544313 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -9297,7 +9297,8 @@ vectorizable_load (vec_info *vinfo,
   class loop *containing_loop = gimple_bb (stmt_info->stmt)->loop_father;
   bool nested_in_vect_loop = false;
   tree elem_type;
-  tree new_temp;
+  /* Avoid false positive uninitialized warning, see PR110652.  */
+  tree new_temp = NULL_TREE;
   machine_mode mode;
   tree dummy;
   tree dataref_ptr = NULL_TREE;
--
2.31.1

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

end of thread, other threads:[~2023-07-17  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17  2:22 [PATCH] vect: Initialize new_temp to avoid false positive warning [PR110652] Kewen.Lin
2023-07-17  6:39 ` Richard Biener
2023-07-17  8:48   ` Kewen.Lin

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