mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Insert type guards (CHECK_OP1_TRACE_TYPE / CHECK_OP2_TRACE_TYPE) on the sensitive bailout paths in ADD/SUB/MUL JIT compilation: the MAY_BE_UNDEF and non-numeric operand breaks. Guards are only emitted when the traced operand type is IS_LONG or IS_DOUBLE, ensuring TSSA result type predictions stay valid for side traces without affecting the normal numeric fast path. Fixes GH-20838 Co-authored-by: Dmitry Stogov <dmitrystogov@gmail.com>
67 lines
818 B
PHP
67 lines
818 B
PHP
--TEST--
|
|
GH-20838 (JIT compiler produces wrong arithmetic results)
|
|
--INI--
|
|
opcache.enable=1
|
|
opcache.enable_cli=1
|
|
opcache.jit=tracing
|
|
opcache.jit_buffer_size=64M
|
|
opcache.jit_hot_loop=61
|
|
opcache.jit_hot_func=127
|
|
opcache.jit_hot_return=8
|
|
opcache.jit_hot_side_exit=8
|
|
--EXTENSIONS--
|
|
opcache
|
|
--FILE_EXTERNAL--
|
|
gh20838.inc
|
|
--EXPECT--
|
|
49 0
|
|
1080 18
|
|
4415 31.25
|
|
4763 75
|
|
4926 75
|
|
4933 60
|
|
4935 75
|
|
4938 75
|
|
4939 75
|
|
4947 60
|
|
4952 45
|
|
4953 75
|
|
4962 60
|
|
8558 45
|
|
14888 45
|
|
16879 13
|
|
100003 0
|
|
100007 60
|
|
100013 0
|
|
100017 13
|
|
100019 15
|
|
100027 45
|
|
100031 30
|
|
106427 -37.5
|
|
217955 -9
|
|
240000 30
|
|
240010 60
|
|
240021 45
|
|
240079 112.66666666667
|
|
240210 45
|
|
240227 45
|
|
240249 75
|
|
240273 75
|
|
240333 30
|
|
240335 60
|
|
300024 96.5
|
|
310001 45
|
|
310025 45
|
|
310034 60
|
|
310042 30
|
|
310111 75
|
|
310191 45
|
|
310219 75
|
|
310236 15
|
|
310322 45
|
|
310356 30
|
|
310360 21.25
|
|
310394 29.5
|
|
310405 75
|
|
310411 60
|