2
0
Эх сурвалжийг харах

* 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 жил өмнө
parent
commit
4e2de05667

+ 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