From 86b85798bdfec9e3fee66d8e723fbbf56ae0b69a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 26 Jan 2021 14:27:48 -0500 Subject: [PATCH] nouveau: Silence some warnings at -Og MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp: In member function ‘bool {anonymous}::Converter::handleInstruction(const tgsi_full_instruction*)’: ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:3419:22: warning: ‘src1’ may be used uninitialized in this function [-Wmaybe-uninitialized] 3419 | geni = mkOp3(op, dstTy, dst0[c], fetchSrc(0, c), src1, mkImm(0x1f)); ../src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp:3272:15: warning: ‘val1’ may be used uninitialized in this function [-Wmaybe-uninitialized] 3272 | mkOp1(OP_EX2, TYPE_F32, dst0[1], val1); Can't happen, just initialize them to NULL. Reviewed-by: Eric Anholt Reviewed-by: Karol Herbst Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index 8eb7104..b2e0fb0 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -3121,7 +3121,7 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn) Value *dst0[4], *rDst0[4]; Value *src0, *src1, *src2, *src3; - Value *val0, *val1; + Value *val0 = NULL, *val1 = NULL; int c; tgsi = tgsi::Instruction(insn); @@ -3415,6 +3415,8 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn) case TGSI_OPCODE_READ_INVOC: if (tgsi.getOpcode() == TGSI_OPCODE_READ_INVOC) src1 = fetchSrc(1, 0); + else + src1 = val0; FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) { geni = mkOp3(op, dstTy, dst0[c], fetchSrc(0, c), src1, mkImm(0x1f)); geni->subOp = NV50_IR_SUBOP_SHFL_IDX; -- 2.7.4