Browse Source

* fix for TCpuAsmOptimizer.OptPass1SXTW

florian 2 years ago
parent
commit
fd94b6db91
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/aarch64/aoptcpu.pas

+ 1 - 1
compiler/aarch64/aoptcpu.pas

@@ -733,7 +733,7 @@ Implementation
         (taicpu(p).ops=2) and
         (taicpu(p).ops=2) and
         GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
         GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
         MatchInstruction(hp1, A_STR, [C_None], [PF_None]) and
         MatchInstruction(hp1, A_STR, [C_None], [PF_None]) and
-        (getsubreg(taicpu(p).oper[0]^.reg)=R_SUBD) and
+        (getsubreg(taicpu(hp1).oper[0]^.reg)=R_SUBD) and
         RegEndofLife(taicpu(p).oper[0]^.reg,taicpu(hp1)) and
         RegEndofLife(taicpu(p).oper[0]^.reg,taicpu(hp1)) and
         { the reference in strb might not use reg2 }
         { the reference in strb might not use reg2 }
         not(RegInRef(taicpu(p).oper[0]^.reg,taicpu(hp1).oper[1]^.ref^)) and
         not(RegInRef(taicpu(p).oper[0]^.reg,taicpu(hp1).oper[1]^.ref^)) and