Skip to content

Commit 39fa9cf

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Add test for GH-16355 (fixed by previous commit) Update IR UPGRADING: Fix `IntlTimeZone::getIanaID` new method notice
2 parents 95dbc33 + c98c198 commit 39fa9cf

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

ext/opcache/jit/ir/ir_gcm.c

+19
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,25 @@ static uint32_t ir_gcm_select_best_block(ir_ctx *ctx, ir_ref ref, uint32_t lca)
112112
bb = &ctx->cfg_blocks[b];
113113
if (bb->loop_depth < loop_depth) {
114114
if (!bb->loop_depth) {
115+
#if 1
116+
/* Avoid LICM if LOOP doesn't have a pre-header block */
117+
ir_block *loop_bb = &ctx->cfg_blocks[best];
118+
119+
if (!(loop_bb->flags & IR_BB_LOOP_HEADER)) {
120+
loop_bb = &ctx->cfg_blocks[loop_bb->loop_header];
121+
}
122+
if (loop_bb->predecessors_count > 2) {
123+
int n = loop_bb->predecessors_count;
124+
uint32_t *p = ctx->cfg_edges + loop_bb->predecessors;
125+
126+
while (n && *p != b) {
127+
n--; p++;
128+
}
129+
if (!n) {
130+
break;
131+
}
132+
}
133+
#endif
115134
best = b;
116135
break;
117136
}

ext/opcache/tests/jit/gh16355.phpt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
GH-16355 (Assertion failure in ext/opcache/jit/ir/ir_ra.c:1139)
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.jit=1203
7+
opcache.jit_buffer_size=64M
8+
--FILE--
9+
<?php
10+
function test($in, $cond) {
11+
if ($cond) {
12+
eval('');
13+
}
14+
while (stream_bucket_make_writeable($in)) {}
15+
}
16+
?>
17+
DONE
18+
--EXPECT--
19+
DONE

0 commit comments

Comments
 (0)