radv: Squelch possibly-undefined warning
authorEric Anholt <eric@anholt.net>
Tue, 17 Dec 2019 04:00:00 +0000 (20:00 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 18 Feb 2020 23:35:32 +0000 (15:35 -0800)
The same condition is used in the def as in the use, but gcc wasn't
figuring it out.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3867>

src/amd/vulkan/radv_nir_to_llvm.c

index 422ffa1769977daa912c19e7bd49f1d07b1f42a7..49c91aeb04e78dc9914c7f897e053086338dbbdf 100644 (file)
@@ -4188,7 +4188,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
 
                ac_setup_rings(&ctx);
 
-               LLVMBasicBlockRef merge_block;
+               LLVMBasicBlockRef merge_block = NULL;
                if (shader_count >= 2 || is_ngg) {
                        LLVMValueRef fn = LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx.ac.builder));
                        LLVMBasicBlockRef then_block = LLVMAppendBasicBlockInContext(ctx.ac.context, fn, "");