diff --git a/src/intel/compiler/brw_print.cpp b/src/intel/compiler/brw_print.cpp index d19b4fe479e..6467c370cd5 100644 --- a/src/intel/compiler/brw_print.cpp +++ b/src/intel/compiler/brw_print.cpp @@ -30,8 +30,14 @@ brw_print_instructions(const brw_shader &s, FILE *file) fprintf(file, "\n"); foreach_inst_in_block(brw_inst, inst, block) { - if (inst->is_control_flow_end()) + /* SHADER_OPCODE_FLOW ends a block, but it does not change the + * control flow nested (i.e., the indentation). + */ + if (inst->is_control_flow_end() && inst->opcode != SHADER_OPCODE_FLOW) { + /* If cf_count is 0 and decremented, bad things will happen. */ + assert(cf_count > 0); cf_count -= 1; + } if (rp) { max_pressure = MAX2(max_pressure, rp->regs_live_at_ip[ip]);