nouveau: Silence a warning at -Og

../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp: In member function ‘void nv50_ir::AlgebraicOpt::handleCVT_EXTBF(nv50_ir::Instruction*)’:
   ../src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp:2238:57: warning: ‘offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Just set it to 0 to handle the corner case.

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:30:28 -05:00
committed by Marge Bot
parent 86b85798bd
commit 3f290b4f65
@@ -2167,7 +2167,7 @@ AlgebraicOpt::handleCVT_EXTBF(Instruction *cvt)
Instruction *insn = cvt->getSrc(0)->getInsn();
ImmediateValue imm;
Value *arg = NULL;
unsigned width, offset;
unsigned width, offset = 0;
if ((cvt->sType != TYPE_U32 && cvt->sType != TYPE_S32) || !insn)
return;
if (insn->op == OP_EXTBF && insn->src(1).getImmediate(imm)) {
@@ -2199,7 +2199,7 @@ AlgebraicOpt::handleCVT_EXTBF(Instruction *cvt)
arg = insn->getSrc(!s);
Instruction *shift = arg->getInsn();
offset = 0;
if (shift && shift->op == OP_SHR &&
shift->sType == cvt->sType &&
shift->src(1).getImmediate(imm) &&