Browse Source

* patch by Nico Erfurth: Minor fix for FoldShiftProcess peephole optimizer on ARM
Use UpdateUsedRegs and drop the check for reloading of the register, as
this is done in RegUsedAfterInstruction now.

git-svn-id: trunk@21520 -

florian 13 years ago
parent
commit
6e8594a9af
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/arm/aoptcpu.pas

+ 2 - 2
compiler/arm/aoptcpu.pas

@@ -533,8 +533,8 @@ Implementation
                        ) then
                        ) then
                       begin
                       begin
                         CopyUsedRegs(TmpUsedRegs);
                         CopyUsedRegs(TmpUsedRegs);
-                        if not(RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,hp1,TmpUsedRegs)) or
-                           (MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[0]^)) then
+                        UpdateUsedRegs(TmpUsedRegs, tai(p.next));
+                        if not(RegUsedAfterInstruction(taicpu(p).oper[0]^.reg,hp1,TmpUsedRegs)) then
                           for I:=1 to 2 do
                           for I:=1 to 2 do
                             if MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) then
                             if MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) then
                               begin
                               begin