mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 01:39:26 +02:00
+ tai_regalloc.keep to force register deallocations to be keep
git-svn-id: trunk@22187 -
This commit is contained in:
parent
c0425c48fd
commit
b6608e716b
@ -644,6 +644,7 @@ interface
|
|||||||
tai_regalloc = class(tai)
|
tai_regalloc = class(tai)
|
||||||
reg : tregister;
|
reg : tregister;
|
||||||
ratype : TRegAllocType;
|
ratype : TRegAllocType;
|
||||||
|
keep : boolean;
|
||||||
{ reg(de)alloc belongs to this instruction, this
|
{ reg(de)alloc belongs to this instruction, this
|
||||||
is only used for automatic inserted (de)alloc for
|
is only used for automatic inserted (de)alloc for
|
||||||
imaginary register and required for spilling code }
|
imaginary register and required for spilling code }
|
||||||
|
@ -25,6 +25,8 @@ Unit aopt;
|
|||||||
|
|
||||||
{$i fpcdefs.inc}
|
{$i fpcdefs.inc}
|
||||||
|
|
||||||
|
{ $define DEBUG_OPTALLOC}
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
@ -195,13 +197,14 @@ Unit aopt;
|
|||||||
{$endif DEBUG_OPTALLOC}
|
{$endif DEBUG_OPTALLOC}
|
||||||
AsmL.Remove(p);
|
AsmL.Remove(p);
|
||||||
InsertLLItem(hp2, tai(hp2.Next), p);
|
InsertLLItem(hp2, tai(hp2.Next), p);
|
||||||
|
tai_regalloc(p).keep:=true;
|
||||||
{$ifdef DEBUG_OPTALLOC}
|
{$ifdef DEBUG_OPTALLOC}
|
||||||
AsmL.InsertAfter(tai_comment.Create(strpnew('Moved deallocation of '+std_regname(tai_regalloc(p).Reg)+' here')),hp2);
|
AsmL.InsertAfter(tai_comment.Create(strpnew('Moved deallocation of '+std_regname(tai_regalloc(p).Reg)+' here')),hp2);
|
||||||
{$endif DEBUG_OPTALLOC}
|
{$endif DEBUG_OPTALLOC}
|
||||||
p := hp1;
|
p := hp1;
|
||||||
End
|
End
|
||||||
else if findregalloc(tai_regalloc(p).reg, tai(p.next))
|
else if findregalloc(tai_regalloc(p).reg, tai(p.next))
|
||||||
and getnextinstruction(p,hp1) then
|
and getnextinstruction(p,hp1) and not(tai_regalloc(p).keep) then
|
||||||
begin
|
begin
|
||||||
hp1 := tai(p.previous);
|
hp1 := tai(p.previous);
|
||||||
{$ifdef DEBUG_OPTALLOC}
|
{$ifdef DEBUG_OPTALLOC}
|
||||||
|
Loading…
Reference in New Issue
Block a user