[Mesa-dev] [PATCH v2] vc4: Correct typo setting 'handled_qinst_cond'

Rhys Kidd rhyskidd at gmail.com
Sat Feb 13 18:21:15 UTC 2016


Variable was previously always set to true. Accordingly, the later
assert() served no active purpose.

Found with GCC warning and code inspection:

mesa/src/gallium/drivers/vc4/vc4_qpu_emit.c: In function'vc4_generate_code':
mesa/src/gallium/drivers/vc4/vc4_qpu_emit.c:315:22: warning: variable 'handled_qinst_cond' set but not used [-Wunused-but-set-variable]
                 bool handled_qinst_cond = true;
                      ^

Separately, the early break for MOV no-ops in the default switch case
will trigger the assert() in debug builds.

    ...
    /* Skip emitting the MOV if it's a no-op. */
    if (qir_is_raw_mov(qinst) &&
        dst.mux == src[0].mux && dst.addr == src[0].addr) {
            break;
    }
    ...

This code path is tickled now that this typo is corrected.

Signed-off-by: Rhys Kidd <rhyskidd at gmail.com>
---
 src/gallium/drivers/vc4/vc4_qpu_emit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index b06702af..450b97f 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -312,7 +312,7 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                         break;
                 }
 
-                bool handled_qinst_cond = true;
+                bool handled_qinst_cond = false;
 
                 switch (qinst->op) {
                 case QOP_RCP:
-- 
2.5.0



More information about the mesa-dev mailing list