]> granicus.if.org Git - php/commitdiff
Eliminate dead load
authorDmitry Stogov <dmitry@zend.com>
Fri, 9 Oct 2020 15:58:03 +0000 (18:58 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 9 Oct 2020 15:58:03 +0000 (18:58 +0300)
ext/opcache/jit/zend_jit_trace.c

index f9c9a961921f9eff81e38af86703ce12c2575873..7fb1e08c0c79ebc38557e1fb935ec5edba3c34ba 100644 (file)
@@ -3345,7 +3345,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
                 && trace_buffer->stop != ZEND_JIT_TRACE_STOP_RECURSIVE_CALL
                 && trace_buffer->stop != ZEND_JIT_TRACE_STOP_RECURSIVE_RET) {
                        for (i = 0; i < last_var; i++) {
-                               if (ra[i] && (ra[i]->flags & ZREG_LOAD) != 0) {
+                               if (ra[i]
+                                && (ra[i]->flags & ZREG_LOAD) != 0
+                                && ra[i]->reg != stack[i].reg) {
                                        SET_STACK_REG_EX(stack, i, ra[i]->reg, ZREG_LOAD);
                                        if (!zend_jit_load_var(&dasm_state, ssa->var_info[i].type, i, ra[i]->reg)) {
                                                goto jit_failure;