ac/llvm: fix warning in ac_build_canonicalize()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 25 Nov 2019 07:51:16 +0000 (08:51 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Nov 2019 07:35:10 +0000 (08:35 +0100)
../src/amd/llvm/ac_llvm_build.c: In function ‘ac_build_canonicalize’:
../src/amd/llvm/ac_llvm_build.c:4567:9: warning: ‘intr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 4567 |  return ac_build_intrinsic(ctx, intr, type, params, 1,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 4568 |       AC_FUNC_ATTR_READNONE);
      |       ~~~~~~~~~~~~~~~~~~~~~~
../src/amd/llvm/ac_llvm_build.c:4567:9: warning: ‘type’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/amd/llvm/ac_llvm_build.c

index 60213fdd5d76fe4985701beb1cc42396a759ba6b..1cd687366d724a06d793cc081b8b743a8b022f28 100644 (file)
@@ -4553,7 +4553,7 @@ ac_build_canonicalize(struct ac_llvm_context *ctx, LLVMValueRef src0,
        } else if (bitsize == 32) {
                intr = "llvm.canonicalize.f32";
                type = ctx->f32;
-       } else if (bitsize == 64) {
+       } else {
                intr = "llvm.canonicalize.f64";
                type = ctx->f64;
        }