From 01afee1f734b166dfa38473b5ee1111f3d75c775 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 21 Oct 2006 21:31:08 +0000 Subject: [PATCH] * Add extra calls to get_alias to properly recognize coalesced registers to be spilled. git-svn-id: trunk@4997 - --- compiler/rgobj.pas | 6 +++--- compiler/x86/rgx86.pas | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas index df22a6b852..2d0aa47d10 100644 --- a/compiler/rgobj.pas +++ b/compiler/rgobj.pas @@ -162,6 +162,7 @@ unit rgobj; { can be overriden to add cpu specific interferences } procedure add_cpu_interferences(p : tai);virtual; procedure add_constraints(reg:Tregister);virtual; + function get_alias(n:Tsuperregister):Tsuperregister; function getregisterinline(list:TAsmList;subreg:Tsubregister):Tregister; procedure ungetregisterinline(list:TAsmList;r:Tregister); function get_spill_subreg(r : tregister) : tsubregister;virtual; @@ -225,7 +226,6 @@ unit rgobj; procedure enable_moves(n:Tsuperregister); procedure decrement_degree(m:Tsuperregister); procedure simplify; - function get_alias(n:Tsuperregister):Tsuperregister; procedure add_worklist(u:Tsuperregister); function adjacent_ok(u,v:Tsuperregister):boolean; function conservative(u,v:Tsuperregister):boolean; @@ -1818,7 +1818,7 @@ unit rgobj; supreg : tsuperregister; begin tmpindex := regindex; - supreg:=getsupreg(reg); + supreg:=get_alias(getsupreg(reg)); { did we already encounter this register? } for i := 0 to pred(regindex) do if (regs[i].orgreg = supreg) then @@ -1856,7 +1856,7 @@ unit rgobj; i: longint; supreg: tsuperregister; begin - supreg:=getsupreg(reg); + supreg:=get_alias(getsupreg(reg)); for i:=0 to pred(regindex) do if (regs[i].mustbespilled) and (regs[i].orgreg=supreg) then diff --git a/compiler/x86/rgx86.pas b/compiler/x86/rgx86.pas index 88de47e33e..6fccf33b56 100644 --- a/compiler/x86/rgx86.pas +++ b/compiler/x86/rgx86.pas @@ -139,11 +139,11 @@ implementation begin { One of the arguments shall be able to be replaced } if (getregtype(oper[0]^.reg)=regtype) and - (getsupreg(oper[0]^.reg)=orgreg) then + (get_alias(getsupreg(oper[0]^.reg))=orgreg) then replaceoper:=0 else if (getregtype(oper[1]^.reg)=regtype) and - (getsupreg(oper[1]^.reg)=orgreg) then + (get_alias(getsupreg(oper[1]^.reg))=orgreg) then replaceoper:=1 else internalerror(200410106);