From 8e8c5a73ee8bde7f8496cc32a998b9f14f133a1d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 29 May 2020 13:27:47 +0300 Subject: [PATCH] Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt) --- ext/opcache/jit/zend_jit_trace.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 741662da55..f72c87e4f7 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -2006,9 +2006,18 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace && (ssa->vars[ssa_op->result_def].use_chain >= 0 || ssa->vars[ssa_op->result_def].phi_use_chain) && zend_jit_var_supports_reg(ssa, ssa_op->result_def)) { - start[ssa_op->result_def] = idx; - vars_op_array[ssa_op->result_def] = op_array; - count++; + if (!(ssa->var_info[ssa_op->result_def].type & MAY_BE_GUARD) + || opline->opcode == ZEND_PRE_INC + || opline->opcode == ZEND_PRE_DEC + || opline->opcode == ZEND_POST_INC + || opline->opcode == ZEND_POST_DEC + || opline->opcode == ZEND_ADD + || opline->opcode == ZEND_SUB + || opline->opcode == ZEND_MUL) { + start[ssa_op->result_def] = idx; + vars_op_array[ssa_op->result_def] = op_array; + count++; + } } if (ssa_op->op1_def >= 0 && (ssa->vars[ssa_op->op1_def].use_chain >= 0 -- 2.40.0