From efcdc7f7d88ef74f4701f7cf79d0c13951fd0ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 1 Apr 2021 15:16:35 +0200 Subject: [PATCH] intel/blorp: Initialize texture_data[0] Avoids warning with GCC 10: ../src/intel/blorp/blorp_blit.c: In function 'blorp_nir_combine_samples': ../src/intel/blorp/blorp_blit.c:702:25: error: 'texture_data[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] 702 | texture_data[0] = nir_fmul(b, texture_data[0], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 703 | nir_imm_float(b, 1.0 / tex_samples)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Jason Ekstrand Part-of: --- src/intel/blorp/blorp_blit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index fb207168d31..6dac15fd105 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -635,6 +635,7 @@ blorp_nir_combine_samples(nir_builder *b, struct brw_blorp_blit_vars *v, * operations and skip the final division. */ nir_ssa_def *texture_data[5]; + texture_data[0] = NULL; /* Avoid maybe-uninitialized warning with GCC 10 */ unsigned stack_depth = 0; for (unsigned i = 0; i < tex_samples; ++i) { assert(stack_depth == util_bitcount(i)); /* Loop invariant */