mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 12:44:39 +01:00
* fixed another bug in allocregbetween (introduced by the previous fix)
("merged")
This commit is contained in:
parent
95351bb8f7
commit
bbd2e6cdaf
@ -1118,8 +1118,8 @@ Procedure AllocRegBetween(AsmL: PAasmOutput; Reg: TRegister; p1, p2: Pai);
|
|||||||
{ allocates register Reg between (and including) instructions p1 and p2 }
|
{ allocates register Reg between (and including) instructions p1 and p2 }
|
||||||
{ the type of p1 and p2 must not be in SkipInstr }
|
{ the type of p1 and p2 must not be in SkipInstr }
|
||||||
var
|
var
|
||||||
hp: pai;
|
hp, start: pai;
|
||||||
lastRemovedWasDealloc: boolean;
|
lastRemovedWasDealloc, firstRemovedWasAlloc, first: boolean;
|
||||||
Begin
|
Begin
|
||||||
If not(reg in usableregs+[R_EDI,R_ESI]) or
|
If not(reg in usableregs+[R_EDI,R_ESI]) or
|
||||||
not(assigned(p1)) Then
|
not(assigned(p1)) Then
|
||||||
@ -1127,6 +1127,8 @@ Begin
|
|||||||
{ current block (e.g. esi with self) }
|
{ current block (e.g. esi with self) }
|
||||||
exit;
|
exit;
|
||||||
lastRemovedWasDealloc := false;
|
lastRemovedWasDealloc := false;
|
||||||
|
firstRemovedWasAlloc := false;
|
||||||
|
first := true;
|
||||||
{$ifdef allocregdebug}
|
{$ifdef allocregdebug}
|
||||||
hp := new(pai_asm_comment,init(strpnew('allocating '+att_reg2str[reg]+
|
hp := new(pai_asm_comment,init(strpnew('allocating '+att_reg2str[reg]+
|
||||||
' from here...')));
|
' from here...')));
|
||||||
@ -1135,12 +1137,7 @@ Begin
|
|||||||
' till here...')));
|
' till here...')));
|
||||||
insertllitem(asml,p2,p1^.next,hp);
|
insertllitem(asml,p2,p1^.next,hp);
|
||||||
{$endif allocregdebug}
|
{$endif allocregdebug}
|
||||||
if not Assigned(p1^.optInfo) or
|
start := p1;
|
||||||
not (reg in PPaiProp(p1^.OptInfo)^.UsedRegs) then
|
|
||||||
begin
|
|
||||||
hp := new(paiRegalloc,alloc(reg));
|
|
||||||
insertLLItem(asmL,p1^.previous,p1,hp);
|
|
||||||
end;
|
|
||||||
Repeat
|
Repeat
|
||||||
If Assigned(p1^.OptInfo) Then
|
If Assigned(p1^.OptInfo) Then
|
||||||
Include(PPaiProp(p1^.OptInfo)^.UsedRegs,Reg);
|
Include(PPaiProp(p1^.OptInfo)^.UsedRegs,Reg);
|
||||||
@ -1154,6 +1151,11 @@ Begin
|
|||||||
(p1^.typ = ait_regalloc) Then
|
(p1^.typ = ait_regalloc) Then
|
||||||
If (PaiRegAlloc(p1)^.Reg = Reg) Then
|
If (PaiRegAlloc(p1)^.Reg = Reg) Then
|
||||||
Begin
|
Begin
|
||||||
|
if first then
|
||||||
|
begin
|
||||||
|
firstRemovedWasAlloc := PaiRegAlloc(p1)^.allocation;
|
||||||
|
first := false;
|
||||||
|
end;
|
||||||
lastRemovedWasDealloc := not PaiRegAlloc(p1)^.allocation;
|
lastRemovedWasDealloc := not PaiRegAlloc(p1)^.allocation;
|
||||||
hp := Pai(p1^.Next);
|
hp := Pai(p1^.Next);
|
||||||
AsmL^.Remove(p1);
|
AsmL^.Remove(p1);
|
||||||
@ -1174,7 +1176,12 @@ Begin
|
|||||||
hp := new(paiRegalloc,dealloc(reg));
|
hp := new(paiRegalloc,dealloc(reg));
|
||||||
insertLLItem(asmL,p1,p1^.next,hp);
|
insertLLItem(asmL,p1,p1^.next,hp);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
if firstRemovedWasAlloc then
|
||||||
|
begin
|
||||||
|
hp := new(paiRegalloc,alloc(reg));
|
||||||
|
insertLLItem(asmL,start^.previous,start,hp);
|
||||||
|
end;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function FindRegDealloc(reg: tregister; p: pai): boolean;
|
function FindRegDealloc(reg: tregister; p: pai): boolean;
|
||||||
@ -2436,7 +2443,11 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2000-11-14 13:26:10 jonas
|
Revision 1.7 2000-11-17 15:22:04 jonas
|
||||||
|
* fixed another bug in allocregbetween (introduced by the previous fix)
|
||||||
|
("merged")
|
||||||
|
|
||||||
|
Revision 1.6 2000/11/14 13:26:10 jonas
|
||||||
* fixed bug in allocregbetween
|
* fixed bug in allocregbetween
|
||||||
|
|
||||||
Revision 1.5 2000/11/08 16:04:34 sg
|
Revision 1.5 2000/11/08 16:04:34 sg
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user