[Mesa-dev] [PATCH 06/17] ac/nir: Fix compiler warning about uninitialized dw_addr.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sun Feb 11 14:41:39 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Sat, Feb 10, 2018 at 5:32 PM, Eric Anholt <eric at anholt.net> wrote:
> 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.")
> Cc: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  src/amd/common/ac_nir_to_llvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index cd128054962d..5485062a5bd6 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -6099,7 +6099,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;
> --
> 2.15.0
>


More information about the mesa-dev mailing list