From 28ef5bb74ce1da9beff61b6b9b4a6f6cb41f4435 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 24 Jan 2019 17:18:01 -0800 Subject: [PATCH] intel/compiler: Silence warning about value that may be used uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For some reason, this warning only occurs for me in release builds. In file included from src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c:25:0: src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c: In function ‘brw_nir_lower_mem_access_bit_sizes’: src/compiler/nir/nir_builder.h:501:26: warning: ‘src_swiz[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized] alu_src.swizzle[i] = swiz[i]; ~~~~~~~~~~~~~~~~~~~^~~~~~~~~ src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c:225:16: note: ‘src_swiz[2]’ was declared here unsigned src_swiz[4]; ^~~~~~~~ Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Timothy Arceri --- src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c b/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c index 40ecbb2..0396f5f 100644 --- a/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c +++ b/src/intel/compiler/brw_nir_lower_mem_access_bit_sizes.c @@ -222,7 +222,7 @@ lower_mem_store_bit_size(nir_builder *b, nir_intrinsic_instr *intrin) const unsigned store_src_comps = store_bytes / (bit_size / 8); assert(store_first_src_comp + store_src_comps <= num_components); - unsigned src_swiz[4]; + unsigned src_swiz[4] = { 0, }; for (unsigned i = 0; i < store_src_comps; i++) src_swiz[i] = store_first_src_comp + i; nir_ssa_def *store_value = -- 2.7.4