This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix ASAN bootstrap (uninitialized variable warning)


Hi.

Following patch is needed to survive --with-build-config=bootstrap-asan:

../../gcc/tree-vect-patterns.c: In function âgimple* vect_recog_mask_conversion_pattern(vec<gimple*>*, tree_node**, tree_node**)â:
../../gcc/tree-vect-patterns.c:3612:34: error: âlhsâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    lhs = vect_recog_temp_ssa_var (TREE_TYPE (lhs), NULL);
          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

Ready after it finishes regression tests?
Thanks,
Martin
>From 808bcc26553c7046676d62be4e3a64e6687bf1a2 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 12 May 2016 18:17:27 +0200
Subject: [PATCH] Fix ASAN bootstrap (uninitialized variable warning)

gcc/ChangeLog:

2016-05-12  Martin Liska  <mliska@suse.cz>

	* tree-vect-patterns.c (vect_recog_mask_conversion_pattern):
	Initialize a variable with default value.
---
 gcc/tree-vect-patterns.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index d08b454..cc8c445 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -3570,7 +3570,8 @@ vect_recog_mask_conversion_pattern (vec<gimple *> *stmts, tree *type_in,
 {
   gimple *last_stmt = stmts->pop ();
   enum tree_code rhs_code;
-  tree lhs, rhs1, rhs2, tmp, rhs1_type, rhs2_type, vectype1, vectype2;
+  tree lhs = NULL_TREE, rhs1, rhs2, tmp, rhs1_type, rhs2_type;
+  tree vectype1, vectype2;
   stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
   stmt_vec_info pattern_stmt_info;
   vec_info *vinfo = stmt_vinfo->vinfo;
-- 
2.8.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]