mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 20:46:06 +02:00
Fixed issue #26965. The peephole optimization didn't move a potential register deallocation to after the ldr instruction causing mov's to be removed.
git-svn-id: trunk@28977 -
This commit is contained in:
parent
fd97b53016
commit
d3e91bb60c
@ -563,6 +563,7 @@ Implementation
|
|||||||
TmpUsedRegs: TAllUsedRegs;
|
TmpUsedRegs: TAllUsedRegs;
|
||||||
tempop: tasmop;
|
tempop: tasmop;
|
||||||
oldreg: tregister;
|
oldreg: tregister;
|
||||||
|
dealloc: tai_regalloc;
|
||||||
|
|
||||||
function IsPowerOf2(const value: DWord): boolean; inline;
|
function IsPowerOf2(const value: DWord): boolean; inline;
|
||||||
begin
|
begin
|
||||||
@ -1250,6 +1251,13 @@ Implementation
|
|||||||
if taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg then
|
if taicpu(hp1).oper[1]^.ref^.index = taicpu(p).oper[0]^.reg then
|
||||||
taicpu(hp1).oper[1]^.ref^.index := taicpu(p).oper[1]^.reg;
|
taicpu(hp1).oper[1]^.ref^.index := taicpu(p).oper[1]^.reg;
|
||||||
|
|
||||||
|
dealloc:=FindRegDeAlloc(taicpu(p).oper[1]^.reg, taicpu(p.Next));
|
||||||
|
if Assigned(dealloc) then
|
||||||
|
begin
|
||||||
|
asml.remove(dealloc);
|
||||||
|
asml.InsertAfter(dealloc,hp1);
|
||||||
|
end;
|
||||||
|
|
||||||
GetNextInstruction(p, hp1);
|
GetNextInstruction(p, hp1);
|
||||||
asml.remove(p);
|
asml.remove(p);
|
||||||
p.free;
|
p.free;
|
||||||
|
Loading…
Reference in New Issue
Block a user