From f28a42c9239142441bf3e3149f5d76efab71aac2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Wed, 28 Apr 2010 22:00:40 +0200 Subject: Fix PHI elimination: mark right PHI as used, too. --- src/lj_opt_loop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lj_opt_loop.c b/src/lj_opt_loop.c index e0e6990e..48207dd5 100644 --- a/src/lj_opt_loop.c +++ b/src/lj_opt_loop.c @@ -133,7 +133,11 @@ static void loop_emit_phi(jit_State *J, IRRef1 *subst, IRRef1 *phi, IRRef nphi) while (!irref_isk(ref) && ref != subst[ref]) { IRIns *ir = IR(ref); irt_clearmark(ir->t); /* Unmark potential uses, too. */ - if (irt_isphi(ir->t) || irt_ispri(ir->t)) + if (irt_isphi(ir->t)) { + irt_clearmark(IR(subst[ref])->t); + break; + } + if (irt_ispri(ir->t)) break; irt_setphi(ir->t); if (nphi >= LJ_MAX_PHI) -- cgit v1.2.3-55-g6feb