From: Eric Anholt Date: Wed, 14 Mar 2018 21:39:51 +0000 (-0700) Subject: broadcom/vc5: On QPU pack error, dump the instruction and return cleanly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34dc64f6274db73851b0f1e5f0440a9785cafd6c;p=mesa.git broadcom/vc5: On QPU pack error, dump the instruction and return cleanly. This is nice for debugging when you've made a bad instruction. --- diff --git a/src/broadcom/compiler/vir_to_qpu.c b/src/broadcom/compiler/vir_to_qpu.c index 568a004803b..83b1936cbd9 100644 --- a/src/broadcom/compiler/vir_to_qpu.c +++ b/src/broadcom/compiler/vir_to_qpu.c @@ -388,7 +388,13 @@ v3d_vir_to_qpu(struct v3d_compile *c, struct qpu_reg *temp_registers) vir_for_each_inst_inorder(inst, c) { bool ok = v3d_qpu_instr_pack(c->devinfo, &inst->qpu, &c->qpu_insts[i++]); - assert(ok); (void) ok; + if (!ok) { + fprintf(stderr, "Failed to pack instruction:\n"); + vir_dump_inst(c, inst); + fprintf(stderr, "\n"); + c->failed = true; + return; + } } assert(i == c->qpu_inst_count);