Переглянути джерело

Fix minor bug in peephole optimizer.

git-svn-id: trunk@32748 -
Jeppe Johansen 9 роки тому
батько
коміт
803f402bf8
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      compiler/arm/aoptcpu.pas

+ 3 - 0
compiler/arm/aoptcpu.pas

@@ -1442,6 +1442,9 @@ Implementation
                            (not GenerateThumb2Code)
                          )
                        ) and
+                       { Only fold if both registers are used. Otherwise we are folding p with itself }
+                       (taicpu(hp1).oper[1]^.ref^.index<>NR_NO) and
+                       (taicpu(hp1).oper[1]^.ref^.base<>NR_NO) and
                        { Only fold if there isn't another shifterop already, and offset is zero. }
                        (taicpu(hp1).oper[1]^.ref^.offset = 0) and
                        (taicpu(hp1).oper[1]^.ref^.shiftmode = SM_None) and