فهرست منبع

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)
                            (not GenerateThumb2Code)
                          )
                          )
                        ) and
                        ) 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. }
                        { 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^.offset = 0) and
                        (taicpu(hp1).oper[1]^.ref^.shiftmode = SM_None) and
                        (taicpu(hp1).oper[1]^.ref^.shiftmode = SM_None) and