Browse Source

* RemoveSuperfluousMove should not mess with moves targetting lr or pc

git-svn-id: trunk@22185 -
florian 13 years ago
parent
commit
f3f5be2af1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      compiler/arm/aoptcpu.pas

+ 4 - 0
compiler/arm/aoptcpu.pas

@@ -282,6 +282,10 @@ Implementation
       if MatchInstruction(movp, A_MOV, [taicpu(p).condition], [PF_None]) and
          (taicpu(movp).ops=2) and {We can't optimize if there is a shiftop}
          MatchOperand(taicpu(movp).oper[1]^, taicpu(p).oper[0]^.reg) and
+         { don't mess with moves to pc }
+         (taicpu(movp).oper[0]^.reg<>NR_PC) and
+         { don't mess with moves to lr }
+         (taicpu(movp).oper[0]^.reg<>NR_R14) and
          {There is a special requirement for MUL and MLA, oper[0] and oper[1] are not allowed to be the same}
          not (
            (taicpu(p).opcode in [A_MLA, A_MUL]) and