mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 21:50:18 +02:00
* add debug statements
* avoid possible problems with unknown ra_ types git-svn-id: trunk@21304 -
This commit is contained in:
parent
748694a325
commit
75e62e42e4
@ -59,8 +59,10 @@ Unit aopt;
|
||||
Implementation
|
||||
|
||||
uses
|
||||
cutils,
|
||||
globtype, globals,
|
||||
verbose,
|
||||
cpubase,
|
||||
cgbase,
|
||||
aoptda,aoptcpu,aoptcpud;
|
||||
|
||||
@ -145,9 +147,12 @@ Unit aopt;
|
||||
Else
|
||||
Begin
|
||||
hp1 := tai(p.previous);
|
||||
{$ifdef DEBUG_OPTALLOC}
|
||||
AsmL.InsertAfter(tai_comment.Create(strpnew('Removed allocation of '+std_regname(tai_regalloc(p).Reg))),p);
|
||||
{$endif DEBUG_OPTALLOC}
|
||||
AsmL.remove(p);
|
||||
p.free;
|
||||
p := hp1;
|
||||
p := hp1;
|
||||
{ not sure if this is useful, it even skips previous deallocs of the register (FK)
|
||||
hp1 := p;
|
||||
hp2 := nil;
|
||||
@ -160,9 +165,9 @@ Unit aopt;
|
||||
InsertLLItem(tai(hp2.previous), hp2, hp1);
|
||||
End;
|
||||
}
|
||||
End;
|
||||
End;
|
||||
End
|
||||
else
|
||||
else if tai_regalloc(p).ratype=ra_dealloc then
|
||||
Begin
|
||||
ExcludeRegFromUsedRegs(tai_regalloc(p).Reg,Regs);
|
||||
hp1 := p;
|
||||
@ -174,14 +179,23 @@ Unit aopt;
|
||||
If hp2 <> nil Then
|
||||
Begin
|
||||
hp1 := tai(p.previous);
|
||||
{$ifdef DEBUG_OPTALLOC}
|
||||
AsmL.InsertAfter(tai_comment.Create(strpnew('Moved deallocation of '+std_regname(tai_regalloc(p).Reg))),p);
|
||||
{$endif DEBUG_OPTALLOC}
|
||||
AsmL.Remove(p);
|
||||
InsertLLItem(hp2, tai(hp2.Next), p);
|
||||
{$ifdef DEBUG_OPTALLOC}
|
||||
AsmL.InsertAfter(tai_comment.Create(strpnew('Moved deallocation of '+std_regname(tai_regalloc(p).Reg)+' here')),hp2);
|
||||
{$endif DEBUG_OPTALLOC}
|
||||
p := hp1;
|
||||
End
|
||||
else if findregalloc(tai_regalloc(p).reg, tai(p.next))
|
||||
and getnextinstruction(p,hp1) then
|
||||
begin
|
||||
hp1 := tai(p.previous);
|
||||
{$ifdef DEBUG_OPTALLOC}
|
||||
AsmL.InsertAfter(tai_comment.Create(strpnew('Removed deallocation of '+std_regname(tai_regalloc(p).Reg))),p);
|
||||
{$endif DEBUG_OPTALLOC}
|
||||
AsmL.remove(p);
|
||||
p.free;
|
||||
p := hp1;
|
||||
|
Loading…
Reference in New Issue
Block a user