ac/nir: Fix compiler warning about uninitialized dw_addr.
authorEric Anholt <eric@anholt.net>
Sat, 10 Feb 2018 10:37:37 +0000 (10:37 +0000)
committerEric Anholt <eric@anholt.net>
Mon, 12 Feb 2018 20:48:29 +0000 (20:48 +0000)
Even switching the def's condition to be the same chip revision check as
the use, the compiler doesn't figure it out.  Just NULL-init it.

Fixes: ec53e527421d ("ac/nir: Add ES output to LDS for GFX9.")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index d04e24f60013d11c7792a4e7f43562387120ee70..477b98b0d9b8a327eae82e7d67136a64e958e18a 100644 (file)
@@ -6088,7 +6088,7 @@ handle_es_outputs_post(struct nir_to_llvm_context *ctx,
        }
 
        for (unsigned i = 0; i < RADEON_LLVM_MAX_OUTPUTS; ++i) {
-               LLVMValueRef dw_addr;
+               LLVMValueRef dw_addr = NULL;
                LLVMValueRef *out_ptr = &ctx->nir->outputs[i * 4];
                int param_index;
                int length = 4;