瀏覽代碼

Fix check that third parameter of ADDI hp1 instruction is a constant

git-svn-id: trunk@49467 -
pierre 4 年之前
父節點
當前提交
c2c7982a22
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      compiler/riscv/aoptcpurv.pas

+ 1 - 1
compiler/riscv/aoptcpurv.pas

@@ -249,7 +249,7 @@ implementation
                      MatchInstruction(hp1,[A_ADDI{$ifdef riscv64},A_ADDIW{$endif}]) and
                      MatchInstruction(hp1,[A_ADDI{$ifdef riscv64},A_ADDIW{$endif}]) and
                      (taicpu(hp1).ops=3) and
                      (taicpu(hp1).ops=3) and
                      MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) and
                      MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) and
-                     (taicpu(p).oper[2]^.typ=top_const) and
+                     (taicpu(hp1).oper[2]^.typ=top_const) and
                      is_imm12(taicpu(p).oper[2]^.val+taicpu(hp1).oper[2]^.val) and
                      is_imm12(taicpu(p).oper[2]^.val+taicpu(hp1).oper[2]^.val) and
                      (not RegModifiedBetween(taicpu(p).oper[1]^.reg, p,hp1)) and
                      (not RegModifiedBetween(taicpu(p).oper[1]^.reg, p,hp1)) and
                      RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then
                      RegEndOfLife(taicpu(p).oper[0]^.reg, taicpu(hp1)) then