瀏覽代碼

Fixed invalid peephole optimization of ADD/SUB(SP) instructions for ARMv7*M targets.

git-svn-id: trunk@26612 -
Jeppe Johansen 11 年之前
父節點
當前提交
184baa3f99
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      compiler/arm/aoptcpu.pas

+ 2 - 0
compiler/arm/aoptcpu.pas

@@ -2824,6 +2824,8 @@ Implementation
           else if MatchInstruction(p, [A_ADD,A_SUB], [C_None], [PF_None]) and
             (taicpu(p).ops = 2) and
             (taicpu(p).oper[1]^.typ=top_reg) and
+            (not MatchOperand(taicpu(p).oper[0]^, NR_STACK_POINTER_REG)) and
+            (not MatchOperand(taicpu(p).oper[1]^, NR_STACK_POINTER_REG)) and
             (not RegInUsedRegs(NR_DEFAULTFLAGS,UsedRegs)) then
             begin
               DebugMsg('Peephole AddSub2*s done', p);