Browse Source

* i386: Minor PIC initialization improvement if the GOT register is forced to EBX.

git-svn-id: trunk@41462 -
yury 6 years ago
parent
commit
4da16992df
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/i386/cgcpu.pas

+ 4 - 1
compiler/i386/cgcpu.pas

@@ -544,7 +544,10 @@ unit cgcpu;
             if not (target_info.system in [system_i386_darwin,system_i386_iphonesim]) then
               begin
                 { Use ECX as a temp register by default }
-                tmpreg:=NR_ECX;
+                if current_procinfo.got = NR_EBX then
+                  tmpreg:=NR_EBX
+                else
+                  tmpreg:=NR_ECX;
                 { Allocate registers used for parameters to make sure they
                   never allocated during this PIC init code }
                 for i:=0 to current_procinfo.procdef.paras.Count - 1 do