diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
commit | 1903b037de2fb3e75826406b46f055acb70963fa (patch) | |
tree | 604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler/arm/rgcpu.pas | |
parent | ad1141d52f8353457053b925cd674fe1d5c4eafc (diff) | |
parent | 953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff) | |
download | fpc-blocks.tar.gz |
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/arm/rgcpu.pas')
-rw-r--r-- | compiler/arm/rgcpu.pas | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compiler/arm/rgcpu.pas b/compiler/arm/rgcpu.pas index fdb9e0df9e..ca55f59f2c 100644 --- a/compiler/arm/rgcpu.pas +++ b/compiler/arm/rgcpu.pas @@ -290,6 +290,10 @@ unit rgcpu; if abs(spilltemp.offset)>4095 then exit; + { ldr can't set the flags } + if instr.oppostfix=PF_S then + exit; + if GenerateThumbCode and (abs(spilltemp.offset)>1020) then exit; @@ -304,6 +308,11 @@ unit rgcpu; (get_alias(getsupreg(oper[0]^.reg))=orgreg) and (get_alias(getsupreg(oper[1]^.reg))<>orgreg) then begin + { do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 } + if GenerateThumbCode and + (getsupreg(oper[1]^.reg)>RS_R7) then + exit; + { str expects the register in oper[0] } instr.loadreg(0,oper[1]^.reg); instr.loadref(1,spilltemp); @@ -314,6 +323,11 @@ unit rgcpu; (get_alias(getsupreg(oper[1]^.reg))=orgreg) and (get_alias(getsupreg(oper[0]^.reg))<>orgreg) then begin + { do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 } + if GenerateThumbCode and + (getsupreg(oper[0]^.reg)>RS_R7) then + exit; + instr.loadref(1,spilltemp); opcode:=A_LDR; result:=true; |