nouveau: Silence some warnings at -Og

../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 <eric@anholt.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>
This commit is contained in:
Adam Jackson 2021-01-26 14:27:48 -05:00 committed by Marge Bot
parent ba4b9cc0c7
commit 86b85798bd
1 changed files with 3 additions and 1 deletions

View File

@ -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;