Przeglądaj źródła

* reverted rest of r13469 because it causes crashes for linux/ppc64

git-svn-id: trunk@13473 -
Jonas Maebe 16 lat temu
rodzic
commit
6505b4f9c5
4 zmienionych plików z 11 dodań i 21 usunięć
  1. 2 3
      compiler/cgobj.pas
  2. 5 10
      compiler/i386/cgcpu.pas
  3. 3 7
      compiler/ppcgen/cgppc.pas
  4. 1 1
      compiler/psub.pas

+ 2 - 3
compiler/cgobj.pas

@@ -484,7 +484,7 @@ unit cgobj;
           procedure g_external_wrapper(list : TAsmList; procdef: tprocdef; const externalname: string); virtual;
 
           { initialize the pic/got register }
-          function g_maybe_got_init(list: TAsmList; force: boolean): tregister; virtual;
+          procedure g_maybe_got_init(list: TAsmList); virtual;
         protected
           procedure get_subsetref_load_info(const sref: tsubsetreference; out loadsize: tcgsize; out extra_load: boolean);
           procedure a_load_subsetref_regs_noindex(list: TAsmList; subsetsize: tcgsize; loadbitsize: byte; const sref: tsubsetreference; valuereg, extra_value_reg: tregister); virtual;
@@ -3832,9 +3832,8 @@ implementation
         end;
 
 
-    function tcg.g_maybe_got_init(list: TAsmList; force: boolean): tregister;
+    procedure tcg.g_maybe_got_init(list: TAsmList);
       begin
-        result:=NR_NO;
       end;
 
 

+ 5 - 10
compiler/i386/cgcpu.pas

@@ -52,7 +52,7 @@ unit cgcpu;
         procedure g_exception_reason_save_const(list : TAsmList; const href : treference; a: aint);override;
         procedure g_exception_reason_load(list : TAsmList; const href : treference);override;
         procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint);override;
-        function g_maybe_got_init(list: TAsmList; force: boolean): tregister; override;
+        procedure g_maybe_got_init(list: TAsmList); override;
      end;
 
       tcg64f386 = class(tcg64f32)
@@ -494,13 +494,12 @@ unit cgcpu;
       end;
 
 
-    function tcg386.g_maybe_got_init(list: TAsmList; force: boolean): tregister;
+    procedure tcg386.g_maybe_got_init(list: TAsmList);
       begin
         { allocate PIC register }
         if (cs_create_pic in current_settings.moduleswitches) and
            (tf_pic_uses_got in target_info.flags) and
-           (force or
-            (pi_needs_got in current_procinfo.flags)) then
+           (pi_needs_got in current_procinfo.flags) then
           begin
             if (target_info.system<>system_i386_darwin) then
               begin
@@ -508,14 +507,11 @@ unit cgcpu;
                 cg.a_call_name_static(list,'fpc_geteipasebx');
                 list.concat(taicpu.op_sym_ofs_reg(A_ADD,S_L,current_asmdata.RefAsmSymbol('_GLOBAL_OFFSET_TABLE_'),0,NR_PIC_OFFSET_REG));
                 list.concat(tai_regalloc.alloc(NR_PIC_OFFSET_REG,nil));
-                { ecx could be used for a parameter register }
-                result:=NR_EBX;
+                { ecx could be used in leaf procedures }
+                current_procinfo.got:=NR_EBX;
               end
             else
               begin
-                { is not called for darwin/i386 for external stubs }
-                if not assigned(current_procinfo) then
-                  internalerror(2009072801);
                 { can't use ecx, since that one may overwrite a parameter }
                 current_module.requires_ebx_pic_helper:=true;
                 cg.a_call_name_static(list,'fpc_geteipasebx');
@@ -524,7 +520,6 @@ unit cgcpu;
                 { got is already set by ti386procinfo.allocate_got_register }
                 list.concat(tai_regalloc.dealloc(NR_EBX,nil));
                 a_load_reg_reg(list,OS_ADDR,OS_ADDR,NR_EBX,current_procinfo.got);
-                result:=current_procinfo.got;
               end;
           end;
       end;

+ 3 - 7
compiler/ppcgen/cgppc.pas

@@ -62,7 +62,7 @@ unit cgppc;
 
         procedure g_intf_wrapper(list: TAsmList; procdef: tprocdef; const labelname: string; ioffset: longint);override;
 
-        function  g_maybe_got_init(list: TAsmList; force: boolean): tregister; override;
+        procedure g_maybe_got_init(list: TAsmList); override;
        protected
         function  get_darwin_call_stub(const s: string; weak: boolean): tasmsymbol;
         procedure a_load_subsetref_regs_noindex(list: TAsmList; subsetsize: tcgsize; loadbitsize: byte; const sref: tsubsetreference; valuereg, extra_value_reg: tregister); override;
@@ -204,19 +204,16 @@ unit cgppc;
       end;
 
 
-    function tcgppcgen.g_maybe_got_init(list: TAsmList; force: boolean): tregister;
+    procedure tcgppcgen.g_maybe_got_init(list: TAsmList);
       var
          instr: taicpu;
          cond: tasmcond;
         savedlr: boolean;
       begin
-        if not assigned(current_procinfo) then
-          internalerror(2009072802);
         if not(po_assembler in current_procinfo.procdef.procoptions) then
           begin
             if (cs_create_pic in current_settings.moduleswitches) and
-               (force or
-                (pi_needs_got in current_procinfo.flags)) then
+               (pi_needs_got in current_procinfo.flags) then
               case target_info.system of
                 system_powerpc_darwin,
                 system_powerpc64_darwin:
@@ -240,7 +237,6 @@ unit cgppc;
                        { procedures)                                         }
                        not(pi_do_call in current_procinfo.flags) then
                       list.concat(taicpu.op_reg_reg(A_MTSPR,NR_LR,NR_R0));
-                    result:=current_procinfo.got;
                   end;
               end;
           end;

+ 1 - 1
compiler/psub.pas

@@ -1026,7 +1026,7 @@ implementation
             cg.set_regalloc_live_range_direction(rad_backwards_reinit);
             current_filepos:=entrypos;
             { load got if necessary }
-            current_procinfo.got:=cg.g_maybe_got_init(templist,false);
+            cg.g_maybe_got_init(templist);
 
             aktproccode.insertlistafter(headertai,templist);