From 28fe509877495f95b25a191a7935ceeee65520dc Mon Sep 17 00:00:00 2001 From: Zoltan Herczeg Date: Fri, 7 Jun 2024 09:23:08 +0000 Subject: [PATCH] Fix register pair allocation A free register is also allocated Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com --- src/jit/RegisterAlloc.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/jit/RegisterAlloc.cpp b/src/jit/RegisterAlloc.cpp index 450c3e636..fcef8d4da 100644 --- a/src/jit/RegisterAlloc.cpp +++ b/src/jit/RegisterAlloc.cpp @@ -347,15 +347,10 @@ uint8_t RegisterSet::allocateRegisterPair(VariableList::Variable* variable, uint size_t maxRangeEnd; - if (freeReg != VariableList::kUnusedReg) { - if (maxRangeEndSingle1 >= maxRangeEndPair) { - i = maxRangeIndexSingle1; - maxRangeEnd = maxRangeEndSingle1; - } else { - i = maxRangeIndexPair; - maxRangeEnd = maxRangeEndPair; - } - } else if (maxRangeEndPair < maxRangeEndSingle1 && maxRangeEndPair < maxRangeEndSingle2) { + if (freeReg != VariableList::kUnusedReg && maxRangeEndSingle1 >= maxRangeEndPair) { + i = maxRangeIndexSingle1; + maxRangeEnd = maxRangeEndSingle1; + } else if (freeReg == VariableList::kUnusedReg && maxRangeEndPair < maxRangeEndSingle1 && maxRangeEndPair < maxRangeEndSingle2) { i = maxRangeIndexSingle1; maxRangeEnd = maxRangeEndSingle2; freeReg = maxRangeIndexSingle2;