Browse Source

Merged revisions 7832 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7832 | jonas | 2007-06-27 20:30:10 +0200 (Wed, 27 Jun 2007) | 4 lines

* fixed error in register renaming in case the first changed instruction
is an "addl %reg2,%reg1" (was changed into "leal (%reg2,%reg1),%reg2",
now into "leal (%reg1,%reg1),%reg2")

........

git-svn-id: branches/fixes_2_2@7839 -

Jonas Maebe 18 years ago
parent
commit
afe47b6578
1 changed files with 5 additions and 0 deletions
  1. 5 0
      compiler/i386/rropt386.pas

+ 5 - 0
compiler/i386/rropt386.pas

@@ -166,7 +166,12 @@ begin
               internalerror(200402263);
           top_reg:
             begin
+              { "addl %reg2,%reg1" must become "leal (%reg1,%reg1),%reg2" }
+              { since at this point reg1 holds the value that reg2 would  }
+              { otherwise contain                                         }
               tmpref.index := p.oper[0]^.reg;
+              if (getsupreg(tmpref.index)=reg2) then
+                setsupreg(tmpref.index,reg1);
               tmpref.scalefactor := 1;
             end;
           else internalerror(200010031);