2
0
Эх сурвалжийг харах

- moved deallocation of NR_PIC_OFFSET_REG from the x86_64 to the i386 code
generator (as it's also allocated for i386 rather than for x86_64)

git-svn-id: trunk@28928 -

Jonas Maebe 10 жил өмнө
parent
commit
8244d366d0

+ 7 - 0
compiler/i386/cgcpu.pas

@@ -314,6 +314,13 @@ unit cgcpu;
         end;
 
       begin
+        { Release PIC register }
+        if (cs_create_pic in current_settings.moduleswitches) and
+           (tf_pic_uses_got in target_info.flags) and
+           (pi_needs_got in current_procinfo.flags) and
+           not(target_info.system in systems_darwin) then
+          list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
+
         { MMX needs to call EMMS }
         if assigned(rg[R_MMXREGISTER]) and
            (rg[R_MMXREGISTER].uses_registers) then

+ 0 - 4
compiler/x86_64/cgcpu.pas

@@ -330,10 +330,6 @@ unit cgcpu;
         hreg : tregister;
         r : longint;
       begin
-        { Release PIC register }
-        if cs_create_pic in current_settings.moduleswitches then
-          list.concat(tai_regalloc.dealloc(NR_PIC_OFFSET_REG,nil));
-
         { Prevent return address from a possible call from ending up in the epilogue }
         { (restoring registers happens before epilogue, providing necessary padding) }
         if (current_procinfo.flags*[pi_has_unwind_info,pi_do_call,pi_has_saved_regs])=[pi_has_unwind_info,pi_do_call] then