Browse Source

* 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 years ago
parent
commit
f2ccd6e400
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/arm/aoptcpu.pas

+ 3 - 2
compiler/arm/aoptcpu.pas

@@ -1003,8 +1003,9 @@ Implementation
                            )
                            )
                           ) do
                           ) do
                           begin
                           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;
                               break;
                             { reg2 must be either overwritten by the ldr or it is deallocated afterwards }
                             { 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
                             if ((taicpu(hp1).opcode=A_LDR) and (taicpu(p).oper[0]^.reg=taicpu(hp1).oper[0]^.reg)) or