Skip to content

Commit

Permalink
JIT: Fixed test failures introduced in 3d35ac0
Browse files Browse the repository at this point in the history
ext/date/tests/DateTimeZone_compare_basic1.phpt
ext/intl/tests/timezone_equals_error.phpt
  • Loading branch information
dstogov committed Oct 1, 2021
1 parent 3d35ac0 commit 9b3069f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -2913,16 +2913,16 @@ static int zend_jit_trace_end_loop(dasm_State **Dst, int loop_label, const void

static int zend_jit_check_exception(dasm_State **Dst)
{
| MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
| cbnz REG0, ->exception_handler
| MEM_LOAD_64_ZTS ldr, TMP2, executor_globals, exception, TMP1
| cbnz TMP2, ->exception_handler
return 1;
}

static int zend_jit_check_exception_undef_result(dasm_State **Dst, const zend_op *opline)
{
if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
| MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
| cbnz REG0, ->exception_handler_undef
| MEM_LOAD_64_ZTS ldr, TMP2, executor_globals, exception, TMP1
| cbnz TMP2, ->exception_handler_undef
return 1;
}
return zend_jit_check_exception(Dst);
Expand Down Expand Up @@ -7366,11 +7366,11 @@ static int zend_jit_cmp(dasm_State **Dst,
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline, ZREG_TMP1, ZREG_TMP2
}
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline, ZREG_TMP1, ZREG_TMP2
if (may_throw) {
zend_jit_check_exception_undef_result(Dst, opline);
}
| ldr RETVALw, T1 // restore
}
if (may_throw) {
zend_jit_check_exception_undef_result(Dst, opline);
}
if (!zend_jit_cmp_slow(Dst, opline, res_addr, smart_branch_opcode, target_label, target_label2, exit_addr)) {
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -7901,11 +7901,11 @@ static int zend_jit_cmp(dasm_State **Dst,
| FREE_OP opline->op1_type, opline->op1, op1_info, 0, opline
}
| FREE_OP opline->op2_type, opline->op2, op2_info, 0, opline
if (may_throw) {
zend_jit_check_exception_undef_result(Dst, opline);
}
| mov eax, dword T1 // restore
}
if (may_throw) {
zend_jit_check_exception_undef_result(Dst, opline);
}
if (!zend_jit_cmp_slow(Dst, opline, res_addr, smart_branch_opcode, target_label, target_label2, exit_addr)) {
return 0;
}
Expand Down

3 comments on commit 9b3069f

@cmb69
Copy link
Contributor

@cmb69 cmb69 commented on 9b3069f Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikic
Copy link
Member

@nikic nikic commented on 9b3069f Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same error also occurs on azure. There are also some individual test failures that now produce wrong results, e.g. Zend/tests/compare_001_64bit.phpt.

@nikic
Copy link
Member

@nikic nikic commented on 9b3069f Oct 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be enough to reproduce the problem with -d opcache.jit=function (or -d opcache.jit_hot_func=1 --repeat 2):

$var = "foo";
var_dump($var == $var);

Please sign in to comment.