diff options
author | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-11-19 18:05:14 +0000 |
---|---|---|
committer | florian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2017-11-19 18:05:14 +0000 |
commit | 2c3401a427ae65a782413e97385c168452ae693e (patch) | |
tree | 83fa68919c349c82bb48bb390eb4d75d64bc037e /compiler/avr/aoptcpu.pas | |
parent | 68139695bcce879dcacfed7742a0fc3f0703f264 (diff) | |
download | fpc-2c3401a427ae65a782413e97385c168452ae693e.tar.gz |
* 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: https://svn.freepascal.org/svn/fpc/trunk@37604 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/avr/aoptcpu.pas')
-rw-r--r-- | compiler/avr/aoptcpu.pas | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/avr/aoptcpu.pas b/compiler/avr/aoptcpu.pas index 4b0124b1bc..d5dfdd8128 100644 --- a/compiler/avr/aoptcpu.pas +++ b/compiler/avr/aoptcpu.pas @@ -200,22 +200,22 @@ Implementation if p.opcode in [A_MOV,A_LD,A_LDD,A_LDS,A_LPM,A_LDI,A_MOVW] then i:=1; - while(i<p.ops) do + while i<p.ops do begin - case p.oper[I]^.typ of + case p.oper[i]^.typ of top_reg: - Result := (p.oper[I]^.reg = reg) or + Result := (p.oper[i]^.reg = reg) or { MOVW } ((i=1) and (p.opcode=A_MOVW) and (getsupreg(p.oper[0]^.reg)+1=getsupreg(reg))); top_ref: Result := - (p.oper[I]^.ref^.base = reg) or - (p.oper[I]^.ref^.index = reg); + (p.oper[i]^.ref^.base = reg) or + (p.oper[i]^.ref^.index = reg); end; { Bailout if we found something } if Result then exit; - Inc(I); + Inc(i); end; end; @@ -344,8 +344,6 @@ Implementation asml.Remove(p); p.Free; p:=hp1; - - result:=true; end; ReleaseUsedRegs(TmpUsedRegs); end; |