From 3e5f6d322853f4615392217e462a59f1a9c59178 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 9 Oct 2022 21:30:44 +0200 Subject: [PATCH] * use AllocRegbetween in TARMAsmOptimizer.RemoveSuperfluousMove, resolves #39921 --- compiler/armgen/aoptarm.pas | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/compiler/armgen/aoptarm.pas b/compiler/armgen/aoptarm.pas index c8704aa404..55683f3422 100644 --- a/compiler/armgen/aoptarm.pas +++ b/compiler/armgen/aoptarm.pas @@ -315,16 +315,7 @@ Implementation else asml.InsertAfter(dealloc,p); - { try to move the allocation of the target register } - GetLastInstruction(movp,hp1); - alloc:=FindRegAlloc(taicpu(movp).oper[0]^.reg,tai(hp1.Next)); - if assigned(alloc) then - begin - asml.Remove(alloc); - asml.InsertBefore(alloc,p); - { adjust used regs } - IncludeRegInUsedRegs(taicpu(movp).oper[0]^.reg,UsedRegs); - end; + AllocRegBetween(taicpu(movp).oper[0]^.reg,p,movp,UsedRegs); { finally get rid of the mov } taicpu(p).loadreg(0,taicpu(movp).oper[0]^.reg);