|
@@ -308,11 +308,10 @@ 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, the offset is too
|
|
|
- large and the stack pointer reg would be the store source }
|
|
|
+ { do not replace if we're on Thumb, ldr/str cannot be used with rX>r7 }
|
|
|
if GenerateThumbCode and
|
|
|
- (oper[1]^.reg = NR_STACK_POINTER_REG) and
|
|
|
- (abs(spilltemp.offset) > 63) then exit;
|
|
|
+ (getsupreg(oper[1]^.reg)>RS_R7) then
|
|
|
+ exit;
|
|
|
|
|
|
{ str expects the register in oper[0] }
|
|
|
instr.loadreg(0,oper[1]^.reg);
|
|
@@ -324,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;
|