Ver código fonte

ARM: Thumb is an ugly mess, but this at least makes fcl-image package to build with -Ooregvar. someone with more clue is welcomed to review and come up with a better patch.

git-svn-id: trunk@28534 -
Károly Balogh 11 anos atrás
pai
commit
5a7b1f00cf
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      compiler/arm/rgcpu.pas

+ 6 - 0
compiler/arm/rgcpu.pas

@@ -308,6 +308,12 @@ 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 }
+                    if GenerateThumbCode and
+                       (oper[1]^.reg = NR_STACK_POINTER_REG) and
+                       (abs(spilltemp.offset) > 63) then exit;
+
                     { str expects the register in oper[0] }
                     instr.loadreg(0,oper[1]^.reg);
                     instr.loadref(1,spilltemp);