소스 검색

* when doing the AddSubLdr2Ldr optimization check also if the source register of the add is modified before the load

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

+ 3 - 2
compiler/arm/aoptcpu.pas

@@ -1003,8 +1003,9 @@ Implementation
                            )
                           ) do
                           begin
-                            { reg2 might not be changed inbetween }
-                            if RegModifiedBetween(taicpu(p).oper[0]^.reg,p,hp1) then
+                            { neither reg1 nor reg2 might be changed inbetween }
+                            if RegModifiedBetween(taicpu(p).oper[0]^.reg,p,hp1) or
+                              RegModifiedBetween(taicpu(p).oper[1]^.reg,p,hp1) then
                               break;
                             { reg2 must be either overwritten by the ldr or it is deallocated afterwards }
                             if ((taicpu(hp1).opcode=A_LDR) and (taicpu(p).oper[0]^.reg=taicpu(hp1).oper[0]^.reg)) or