Browse Source

* arm thumb: strh/ldrh does not allow stack pointer based references with offset

git-svn-id: trunk@24200 -
florian 12 years ago
parent
commit
e41b7b1b94
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/arm/cgcpu.pas

+ 1 - 1
compiler/arm/cgcpu.pas

@@ -1125,7 +1125,7 @@ unit cgcpu;
             (((oppostfix in [PF_SB,PF_SH]) and (ref.offset<>0)) or
             (((oppostfix in [PF_SB,PF_SH]) and (ref.offset<>0)) or
              ((oppostfix=PF_None) and ((ref.offset<0) or ((ref.base<>NR_STACK_POINTER_REG) and (ref.offset>124)) or
              ((oppostfix=PF_None) and ((ref.offset<0) or ((ref.base<>NR_STACK_POINTER_REG) and (ref.offset>124)) or
                ((ref.base=NR_STACK_POINTER_REG) and (ref.offset>1020)) or ((ref.offset mod 4)<>0))) or
                ((ref.base=NR_STACK_POINTER_REG) and (ref.offset>1020)) or ((ref.offset mod 4)<>0))) or
-             ((oppostfix=PF_H) and ((ref.offset<0) or (ref.offset>62) or ((ref.offset mod 2)<>0))) or
+             ((oppostfix=PF_H) and ((ref.offset<0) or (ref.offset>62) or ((ref.offset mod 2)<>0) or ((getsupreg(ref.base) in [RS_R8..RS_R15]) and (ref.offset<>0)))) or
              ((oppostfix=PF_B) and ((ref.offset<0) or (ref.offset>31) or ((getsupreg(ref.base) in [RS_R8..RS_R15]) and (ref.offset<>0))))
              ((oppostfix=PF_B) and ((ref.offset<0) or (ref.offset>31) or ((getsupreg(ref.base) in [RS_R8..RS_R15]) and (ref.offset<>0))))
             )
             )
            ) then
            ) then