llvmpipe: Silence "possibly uninitialized value" warning for ssbo_limit.
authorEric Anholt <eric@anholt.net>
Tue, 17 Dec 2019 04:05:18 +0000 (20:05 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 18 Feb 2020 23:40:04 +0000 (15:40 -0800)
The condition for the use matches the def, but you can't trust a compiler
to notice.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>

src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index 38e92cb67d3cda800229640f2a2b54e2ffa28afb..8dad6082390390b97a67f1fe92d465725dcc2490 100644 (file)
@@ -3483,7 +3483,7 @@ load_emit(
 
       scalar_ptr = is_shared ? bld->shared_ptr : bld->ssbos[buf];
 
-      LLVMValueRef ssbo_limit;
+      LLVMValueRef ssbo_limit = NULL;
 
       if (!is_shared) {
          ssbo_limit = LLVMBuildAShr(gallivm->builder, bld->ssbo_sizes[buf], lp_build_const_int32(gallivm, 2), "");
@@ -3602,7 +3602,7 @@ store_emit(
 
       scalar_ptr = is_shared ? bld->shared_ptr : bld->ssbos[buf];
 
-      LLVMValueRef ssbo_limit;
+      LLVMValueRef ssbo_limit = NULL;
 
       if (!is_shared) {
          ssbo_limit = LLVMBuildAShr(gallivm->builder, bld->ssbo_sizes[buf], lp_build_const_int32(gallivm, 2), "");