Parcourir la source

* if we find a constant already loaded in a register and we use that
register, mark the register as read by the current instruction
(fixes compilation of tcalfun8 with optimizations)

git-svn-id: trunk@3003 -

Jonas Maebe il y a 19 ans
Parent
commit
af36d177d9
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      compiler/i386/csopt386.pas

+ 4 - 0
compiler/i386/csopt386.pas

@@ -1973,6 +1973,10 @@ begin
                                findRegWithConst(hp1,taicpu(p).opsize,taicpu(p).oper[0]^.val,memreg) then
                               begin
                                 taicpu(p).loadreg(0,memreg);
+                                { mark the used register as read }
+                                incstate(ptaiprop(p.optinfo)^.
+                                   regs[getsupreg(memreg)].rstate,20);
+                                updateState(getsupreg(memreg),p);
                                 allocRegBetween(asml,memreg,
                                   ptaiprop(hp1.optinfo)^.regs[getsupreg(memreg)].startMod,p,
                                   ptaiprop(ptaiprop(hp1.optinfo)^.regs[getsupreg(memreg)].startMod.optinfo)^.usedregs);