Mesa (master): nv50: Fix uninitialized var warnings from using assert() as unreachable().

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 28 23:02:37 UTC 2020


Module: Mesa
Branch: master
Commit: ca73c3bc596eae86aaeb03d0064568e8c0540e07
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca73c3bc596eae86aaeb03d0064568e8c0540e07

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 25 11:28:47 2020 -0700

nv50: Fix uninitialized var warnings from using assert() as unreachable().

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp     | 4 ++--
 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
index 8b0489ca2fa..0758ef09331 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gv100.cpp
@@ -927,7 +927,7 @@ gv100_interpApply(const FixupEntry *entry, uint32_t *code, const FixupData& data
    case NV50_IR_INTERP_DEFAULT : sample = 0; break;
    case NV50_IR_INTERP_CENTROID: sample = 1; break;
    case NV50_IR_INTERP_OFFSET  : sample = 2; break;
-   default: assert(!"invalid sample mode");
+   default: unreachable("invalid sample mode");
    }
 
    int interp;
@@ -936,7 +936,7 @@ gv100_interpApply(const FixupEntry *entry, uint32_t *code, const FixupData& data
    case NV50_IR_INTERP_PERSPECTIVE: interp = 0; break;
    case NV50_IR_INTERP_FLAT       : interp = 1; break;
    case NV50_IR_INTERP_SC         : interp = 2; break;
-   default: assert(!"invalid ipa mode");
+   default: unreachable("invalid ipa mode");
    }
 
    code[loc + 2] &= ~(0xf << 12);
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp
index 644d4928327..480b574e393 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_gv100.cpp
@@ -132,8 +132,7 @@ GV100LegalizeSSA::handleLOP2(Instruction *i)
    case OP_OR : subOp = src0 | src1; break;
    case OP_XOR: subOp = src0 ^ src1; break;
    default:
-      assert(!"invalid LOP2 opcode");
-      break;
+      unreachable("invalid LOP2 opcode");
    }
 
    bld.mkOp3(OP_LOP3_LUT, TYPE_U32, i->getDef(0), i->getSrc(0), i->getSrc(1),



More information about the mesa-commit mailing list