]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Initialize new_temp to avoid false positive warning [PR110652]
authorKewen Lin <linkw@linux.ibm.com>
Mon, 17 Jul 2023 08:44:59 +0000 (03:44 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 17 Jul 2023 08:44:59 +0000 (03:44 -0500)
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.

PR tree-optimization/110652

gcc/ChangeLog:

* tree-vect-stmts.cc (vectorizable_load): Initialize new_temp as
NULL_TREE.

gcc/tree-vect-stmts.cc

index c08d0ef951fc63adcfffc601917134ddf51ece45..cb86d544313f532455a5099c2e2ec33e9d0de522 100644 (file)
@@ -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;