diff mbox

Fix ASAN bootstrap (uninitialized variable warning)

Message ID 5734AF39.4050508@suse.cz
State New
Headers show

Commit Message

Martin Liška May 12, 2016, 4:28 p.m. UTC
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

Comments

Richard Biener May 13, 2016, 9:42 a.m. UTC | #1
On Thu, May 12, 2016 at 6:28 PM, Martin Liška <mliska@suse.cz> wrote:
> 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?

Ok.

Richard.

> Thanks,
> Martin
diff mbox

Patch

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