From 01f3a34eda0a6045db76c703b4c2683b7600fb60 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 27 Aug 2013 15:10:51 +0200 Subject: [PATCH] V4 regalloc: do not overwrite register availability in hole. When a fixed interval for a register is inactive, the register is free until that interval becomes active, or (and this was missing), until another interval uses it before that position. So instead of blindly overwriting the freeUntilPos, take the qMin of the existing one with the intersection position. Change-Id: I2730a748ef1e46b4782fbb9814e800eca52172f0 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4regalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp index d2f2fe3..ddac257 100644 --- a/src/qml/compiler/qv4regalloc.cpp +++ b/src/qml/compiler/qv4regalloc.cpp @@ -1312,7 +1312,7 @@ void RegisterAllocator::tryAllocateFreeReg(LifeTimeInterval ¤t, const int if (it.isFP() == needsFPReg && it.reg() != LifeTimeInterval::Invalid) { const int intersectionPos = nextIntersection(current, it, position); if (!isPhiTarget && it.isFixedInterval() && current.end() == intersectionPos) - freeUntilPos[it.reg()] = intersectionPos + 1; + freeUntilPos[it.reg()] = qMin(freeUntilPos[it.reg()], intersectionPos + 1); else if (intersectionPos != -1) freeUntilPos[it.reg()] = qMin(freeUntilPos[it.reg()], intersectionPos); } -- 2.7.4