* after a LdiMov/Cp2Ldi/Cpi optimization, the compiler should not continue to optimize this instruction because then reg. alloc info is wrong

git-svn-id: trunk@37604 -
This commit is contained in:
florian 2017-11-19 18:05:14 +00:00
parent 81b15d213d
commit ad01f059e8

View File

@ -200,22 +200,22 @@ Implementation
if p.opcode in [A_MOV,A_LD,A_LDD,A_LDS,A_LPM,A_LDI,A_MOVW] then if p.opcode in [A_MOV,A_LD,A_LDD,A_LDS,A_LPM,A_LDI,A_MOVW] then
i:=1; i:=1;
while(i<p.ops) do while i<p.ops do
begin begin
case p.oper[I]^.typ of case p.oper[i]^.typ of
top_reg: top_reg:
Result := (p.oper[I]^.reg = reg) or Result := (p.oper[i]^.reg = reg) or
{ MOVW } { MOVW }
((i=1) and (p.opcode=A_MOVW) and (getsupreg(p.oper[0]^.reg)+1=getsupreg(reg))); ((i=1) and (p.opcode=A_MOVW) and (getsupreg(p.oper[0]^.reg)+1=getsupreg(reg)));
top_ref: top_ref:
Result := Result :=
(p.oper[I]^.ref^.base = reg) or (p.oper[i]^.ref^.base = reg) or
(p.oper[I]^.ref^.index = reg); (p.oper[i]^.ref^.index = reg);
end; end;
{ Bailout if we found something } { Bailout if we found something }
if Result then if Result then
exit; exit;
Inc(I); Inc(i);
end; end;
end; end;
@ -344,8 +344,6 @@ Implementation
asml.Remove(p); asml.Remove(p);
p.Free; p.Free;
p:=hp1; p:=hp1;
result:=true;
end; end;
ReleaseUsedRegs(TmpUsedRegs); ReleaseUsedRegs(TmpUsedRegs);
end; end;