[Mesa-dev] [PATCH 15/17] i965: Silence compiler warning about promoted_constants.

Eric Anholt eric at anholt.net
Sat Feb 10 16:33:08 UTC 2018


We only have a cfg != NULL if we went through one of the paths that set
it, but my compiler doesn't figure that out.

Cc: Jason Ekstrand <jason.ekstrand at intel.com>
Fixes: 6411defdcd6f ("intel/cs: Re-run final NIR optimizations for each SIMD size")
---
 src/intel/compiler/brw_fs.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index bed632d21b91..8a81257b6522 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -7005,7 +7005,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,
    fs_visitor *v8 = NULL, *v16 = NULL, *v32 = NULL;
    cfg_t *cfg = NULL;
    const char *fail_msg = NULL;
-   unsigned promoted_constants;
+   unsigned promoted_constants = 0;
 
    /* Now the main event: Visit the shader IR and generate our CS IR for it.
     */
-- 
2.15.0



More information about the mesa-dev mailing list