소스 검색

* don't apply the AddSubLdr2Ldr optimization if the base register in the reference is used/modified during the ldr/str

git-svn-id: trunk@22222 -
florian 13 년 전
부모
커밋
4e2de05667
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      compiler/arm/aoptcpu.pas

+ 2 - 0
compiler/arm/aoptcpu.pas

@@ -983,6 +983,8 @@ Implementation
                           (MatchInstruction(hp1, A_LDR, [C_None], []) or
                            MatchInstruction(hp1, A_STR, [C_None], [])) and
                           (taicpu(hp1).oper[1]^.ref^.base=taicpu(p).oper[0]^.reg) and
+                          { don't optimize if the register is stored/overwritten }
+                          (taicpu(hp1).oper[0]^.reg<>taicpu(p).oper[1]^.reg) and
                           (taicpu(hp1).oper[1]^.ref^.index=NR_NO) and
                           (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) and
                           { new offset must be valid: either in the range of 8 or 12 bit, depend on the