Ver código fonte

Merged revisions 7261-7262,7317,7983,8031,8053,8081,8090,8107,8171-8172,8282 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7261 | jonas | 2007-05-04 16:52:05 +0200 (Fri, 04 May 2007) | 4 lines

+ support to use r0 for ppc/ppc64 when compiling the compiler with
-duser0. Not active by default because generates wrong code due
to bug in the register allocator

........
r7262 | jonas | 2007-05-04 18:52:26 +0200 (Fri, 04 May 2007) | 2 lines

* r0 is also volatile

........
r7317 | daniel | 2007-05-12 17:43:16 +0200 (Sat, 12 May 2007) | 4 lines

* Change spill_* routines to return Taicpu instead of Tai to increase
strong typing.
* Fix PowerPC R0 register allocation

........
r7983 | tom_at_work | 2007-07-08 22:50:58 +0200 (Sun, 08 Jul 2007) | 1 line

* merged trefaddr.addr_lo/addr_hi with trefaddr.addr_low/addr.high; some related bugfixing/cleanup
........
r8031 | tom_at_work | 2007-07-12 23:00:55 +0200 (Thu, 12 Jul 2007) | 1 line

* use automatic ppc64/linux got/toc entry generation by the linker if possible - removes the need of some workarounds
........
r8053 | tom_at_work | 2007-07-14 21:18:15 +0200 (Sat, 14 Jul 2007) | 1 line

* remove obsolete code
........
r8081 | jonas | 2007-07-17 15:57:15 +0200 (Tue, 17 Jul 2007) | 5 lines

- removed some unused variables
* fixed some (harmless) ptrint warnings
- removed some commented code in agppcmpw
* added one missing field in a typed constant in cp1251

........
r8090 | jonas | 2007-07-18 14:15:55 +0200 (Wed, 18 Jul 2007) | 4 lines

* fixed bootstrapping with 2.0.4
* fixed ppc64 compilation (by reintroducing a bogus ptrint warning, that
code really is correct)

........
r8107 | jonas | 2007-07-20 14:30:16 +0200 (Fri, 20 Jul 2007) | 2 lines

* fixed sparc compilation after addr_lo/hi changes

........
r8171 | jonas | 2007-07-27 19:32:39 +0200 (Fri, 27 Jul 2007) | 2 lines

* renamed opd section (linux/ppc64) to .opd (same as used by gcc)

........
r8172 | tom_at_work | 2007-07-27 22:28:08 +0200 (Fri, 27 Jul 2007) | 1 line

* always use the non-dotted name for function calls and disable putting constants into the got (should be: toc) for now; fixing cycle with "-Cg"
........
r8282 | jonas | 2007-08-14 16:15:35 +0200 (Tue, 14 Aug 2007) | 2 lines

* removed some instructions from the list which considers r0 as 0

........

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

Jonas Maebe 18 anos atrás
pai
commit
2ff0340da7

+ 1 - 7
compiler/aggas.pas

@@ -445,13 +445,10 @@ implementation
       do_line  : boolean;
 
       sepChar : char;
-      nextdwarffileidx : longint;
     begin
       if not assigned(p) then
        exit;
 
-       nextdwarffileidx:=1;
-
       last_align := 2;
       InlineLevel:=0;
       { lineinfo is only needed for al_procedures (PFV) }
@@ -908,7 +905,7 @@ implementation
                if (target_info.system = system_powerpc64_linux) and
                  (tai_symbol(hp).sym.typ = AT_FUNCTION) then
                  begin
-                   AsmWriteLn('.section "opd", "aw"');
+                   AsmWriteLn('.section ".opd", "aw"');
                    AsmWriteLn('.align 3');
                    AsmWriteLn(tai_symbol(hp).sym.name + ':');
                    AsmWriteLn('.quad .' + tai_symbol(hp).sym.name + ', .TOC.@tocbase, 0');
@@ -997,9 +994,6 @@ implementation
                   if CurrSecType<>sec_none then
                     WriteSection(CurrSecType,'',secorder_default);
                   AsmStartSize:=AsmSize;
-
-                  { reset dwarf file index }
-                  nextdwarffileidx:=1;
                 end;
              end;
 

+ 4 - 4
compiler/arm/aasmcpu.pas

@@ -228,8 +228,8 @@ uses
         { nothing to add }
       end;
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
 
     function setoppostfix(i : taicpu;pf : toppostfix) : taicpu;
     function setroundingmode(i : taicpu;rm : troundingmode) : taicpu;
@@ -499,7 +499,7 @@ implementation
       end;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :
@@ -515,7 +515,7 @@ implementation
       end;
 
 
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :

+ 7 - 7
compiler/cgbase.pas

@@ -64,22 +64,22 @@ interface
        trefaddr = (
          addr_no,
          addr_full,
-         {IFNDEF POWERPC64}
-         // these are also available for ppc64 on Mac OS X
-         addr_hi,
-         addr_lo,
-         {ENDIF}
          addr_pic
-         {$IFDEF POWERPC64}
+         {$IF defined(POWERPC) or defined(POWERPC64) or defined(SPARC)}
          ,
          addr_low,         // bits 48-63
          addr_high,        // bits 32-47
+         {$IF defined(POWERPC64)}
          addr_higher,      // bits 16-31
          addr_highest,     // bits 00-15
-         addr_higha,       // bits 16-31, adjusted
+         {$ENDIF}
+         addr_higha        // bits 16-31, adjusted
+         {$IF defined(POWERPC64)}
+         ,
          addr_highera,     // bits 32-47, adjusted
          addr_highesta     // bits 48-63, adjusted
          {$ENDIF}
+         {$ENDIF}
          );
 
 

+ 2 - 2
compiler/cstreams.pas

@@ -462,7 +462,7 @@ begin
     begin
     Result:=FSize-FPosition;
     If Result>Count then Result:=Count;
-    Move (Pointer(PtrInt(FMemory)+FPosition)^,Buffer,Result);
+    Move (Pointer(PtrUInt(FMemory)+PtrUInt(FPosition))^,Buffer,Result);
     FPosition:=Fposition+Result;
     end;
 end;
@@ -613,7 +613,7 @@ begin
       SetCapacity (NewPos);
     FSize:=Newpos;
     end;
-  System.Move (Buffer,Pointer(Ptrint(FMemory)+FPosition)^,Count);
+  System.Move (Buffer,Pointer(Ptruint(FMemory)+PtrUInt(FPosition))^,Count);
   FPosition:=NewPos;
   Result:=Count;
 end;

+ 0 - 3
compiler/dbgdwarf.pas

@@ -1629,8 +1629,6 @@ implementation
       var
         procendlabel   : tasmlabel;
         funcrettype    : tasmsymbol;
-        mangled_length : longint;
-        p              : pchar;
         procentry      : string;
         dreg           : byte;
       begin
@@ -2499,7 +2497,6 @@ implementation
         lastfileinfo : tfileposinfo;
         currfuncname : pshortstring;
         currsectype  : TAsmSectiontype;
-        hlabel       : tasmlabel;
         hp : tai;
         infile : tinputfile;
         prevcolumn,

+ 1 - 2
compiler/fmodule.pas

@@ -434,9 +434,8 @@ implementation
 
     constructor tmodule.create(LoadedFrom:TModule;const s:string;_is_unit:boolean);
       var
-        p,n : string;
+        n : string;
       begin
-        p:=ExtractFilePath(s);
         n:=ChangeFileExt(ExtractFileName(s),'');
         { Programs have the name 'Program' to don't conflict with dup id's }
         if _is_unit then

+ 0 - 4
compiler/fppu.pas

@@ -984,8 +984,6 @@ uses
 
 
     procedure tppumodule.writeppu;
-      var
-        pu : tused_unit;
       begin
          Message1(unit_u_ppu_write,realmodulename^);
 
@@ -1198,11 +1196,9 @@ uses
     procedure tppumodule.load_usedunits;
       var
         pu           : tused_unit;
-        load_refs    : boolean;
       begin
         if current_module<>self then
          internalerror(200212284);
-        load_refs:=true;
 
         { load the used units from interface }
         in_interface:=true;

+ 1 - 3
compiler/globals.pas

@@ -501,7 +501,7 @@ implementation
     procedure TLinkStrMap.Expand(Src:TCmdStrList;Dest:TLinkStrMap);
       // expands every thing in Src to Dest for linkorder purposes.
       var
-        l,r  : longint;
+        r  : longint;
         LibN    : TCmdStr;
       begin
         while not src.empty do
@@ -1149,8 +1149,6 @@ implementation
      end;
 
    procedure InitGlobals;
-     var
-       i : tfeature;
      begin
         get_exepath;
 

+ 1 - 2
compiler/htypechk.pas

@@ -2358,8 +2358,7 @@ implementation
         end;
 
       var
-        paraidx,
-        res: integer;
+        paraidx : integer;
         currpara, bestpara: tparavarsym;
         currvcl, bestvcl: tvariantequaltype;
       begin

+ 4 - 4
compiler/m68k/aasmcpu.pas

@@ -98,8 +98,8 @@ type
   procedure InitAsm;
   procedure DoneAsm;
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
 
   implementation
 
@@ -532,7 +532,7 @@ type
       end;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :
@@ -548,7 +548,7 @@ type
       end;
 
 
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
       begin
 	case getregtype(r) of
 	  R_INTREGISTER :

+ 1 - 1
compiler/nadd.pas

@@ -1781,7 +1781,7 @@ implementation
       var
         p: tnode;
         newstatement : tstatementnode;
-        tempnode,tempnode2 : ttempcreatenode;
+        tempnode (*,tempnode2*) : ttempcreatenode;
         cmpfuncname: string;
       begin
         { when we get here, we are sure that both the left and the right }

+ 0 - 2
compiler/nbas.pas

@@ -449,8 +449,6 @@ implementation
 
 
     function tblocknode.simplify: tnode;
-      var
-        hp, next: tstatementnode;
       begin
         result := nil;
         { Warning: never replace a blocknode with another node type,      }

+ 0 - 1
compiler/ncal.pas

@@ -1457,7 +1457,6 @@ implementation
         objectdf : tobjectdef;
         parents : tlinkedlist;
         objectinfo : tobjectinfoitem;
-        stritem : TCmdStrListItem;
         pd : tprocdef;
         i  : integer;
         first : boolean;

+ 4 - 0
compiler/ncgutil.pas

@@ -2168,9 +2168,11 @@ implementation
 ****************************************************************************}
 
     procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
+{$ifdef x86}
       var
         ref : treference;
         sym : tasmsymbol;
+{$endif x86}
       begin
         { add the procedure to the al_procedures }
         maybe_new_object_file(list);
@@ -2797,8 +2799,10 @@ implementation
 
 
     procedure gen_pic_helpers(list : TAsmList);
+{$ifdef i386}
       var
         href : treference;
+{$endif i386}
       begin
         { if other cpus require such helpers as well, it can be solved more cleaner }
 {$ifdef i386}

+ 0 - 1
compiler/pdecl.pas

@@ -393,7 +393,6 @@ implementation
          sym      : tsym;
          srsymtable : TSymtable;
          hdef     : tdef;
-         oldfilepos,
          defpos,storetokenpos : tfileposinfo;
          old_block_type : tblock_type;
          isgeneric,

+ 3 - 2
compiler/pdecsub.pas

@@ -1273,8 +1273,9 @@ end;
 
 
 procedure pd_dispid(pd:tabstractprocdef);
-var
-  pt : tnode;
+
+var pt:Tnode;
+
 begin
   if pd.typ<>procdef then
     internalerror(200604301);

+ 2 - 4
compiler/pexpr.pas

@@ -1360,15 +1360,13 @@ implementation
        procedure factor_read_id(var p1:tnode;var again:boolean);
          var
            pc    : pchar;
-           len   : longint;
            srsym : tsym;
-           unit_found,
-           possible_error : boolean;
+           unit_found : boolean;
            srsymtable : TSymtable;
            hdef  : tdef;
-           static_name : string;
            orgstoredpattern,
            storedpattern : string;
+           len   : longint;
          begin
            { allow post fix operators }
            again:=true;

+ 1 - 36
compiler/powerpc/agppcmpw.pas

@@ -675,9 +675,7 @@ interface
 
     procedure TPPCMPWAssembler.WriteTree(p:TAsmList);
     var
-      s,
-      prefix,
-      suffix   : string;
+      s        : string;
       hp       : tai;
       hp1      : tailineinfo;
       counter,
@@ -685,11 +683,8 @@ interface
       InlineLevel : longint;
       i,j,l    : longint;
       consttype : taiconst_type;
-      found,
       do_line,DoNotSplitLine,
       quoted   : boolean;
-      sep      : char;
-      replaced : boolean;
       sin      : single;
       d        : double;
 
@@ -1215,43 +1210,13 @@ interface
 
 
     function TPPCMPWAssembler.DoAssemble : boolean;
-    var f : file;
     begin
       DoAssemble:=Inherited DoAssemble;
-      (*
-      { masm does not seem to recognize specific extensions and uses .obj allways PM }
-      if (target_asm.id = as_i386_masm) then
-        begin
-          if not(cs_asm_extern in current_settings.globalswitches) then
-            begin
-              if Not FileExists(objfile) and
-                 FileExists(ForceExtension(objfile,'.obj')) then
-                begin
-                  Assign(F,ForceExtension(objfile,'.obj'));
-                  Rename(F,objfile);
-                end;
-            end
-          else
-            AsmRes.AddAsmCommand('mv',ForceExtension(objfile,'.obj')+' '+objfile,objfile);
-        end;
-      *)
     end;
 
     procedure TPPCMPWAssembler.WriteAsmFileHeader;
 
     begin
-      (*
-      AsmWriteLn(#9'.386p');
-      { masm 6.11 does not seem to like LOCALS PM }
-      if (target_asm.id = as_i386_tasm) then
-        begin
-          AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
-        end;
-      AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA');
-      AsmWriteLn(#9'ASSUME'#9'CS:_CODE,ES:DGROUP,DS:DGROUP,SS:DGROUP');
-      AsmLn;
-      *)
-
       AsmWriteLn(#9'string asis');  {Interpret strings just to be the content between the quotes.}
       AsmWriteLn(#9'aligning off'); {We do our own aligning.}
       AsmLn;

+ 8 - 6
compiler/powerpc/cgcpu.pas

@@ -157,16 +157,16 @@ const
                    RS_R14,RS_R13],first_int_imreg,[]);
               end
             else}
-              rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
-                [RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
+              rg[R_INTREGISTER]:=trgintcpu.create(R_INTREGISTER,R_SUBWHOLE,
+                [{$ifdef user0} RS_R0,{$endif} RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
                  RS_R9,RS_R10,RS_R11,RS_R12,RS_R31,RS_R30,RS_R29,
                  RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
                  RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
                  RS_R14,RS_R13],first_int_imreg,[]);
           end
         else
-          rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
-            [RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
+          rg[R_INTREGISTER]:=trgintcpu.create(R_INTREGISTER,R_SUBWHOLE,
+            [{$ifdef user0} RS_R0,{$endif}RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
              RS_R9,RS_R10,RS_R11,RS_R12,RS_R31,RS_R30,RS_R29,
              RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
              RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
@@ -890,8 +890,8 @@ const
      var regcounter,firstregfpu,firstregint: TSuperRegister;
          href : treference;
          usesfpr,usesgpr,gotgot : boolean;
-         cond : tasmcond;
-         instr : taicpu;
+{         cond : tasmcond;
+         instr : taicpu; }
 
       begin
         { CR and LR only have to be saved in case they are modified by the current }
@@ -1172,8 +1172,10 @@ const
                       abi_powerpc_sysv:
                         reference_reset_base(href,NR_STACK_POINTER_REG,LA_LR_SYSV);
                     end;
+                    a_reg_alloc(list,NR_R0);
                     list.concat(taicpu.op_reg_ref(A_LWZ,NR_R0,href));
                     list.concat(taicpu.op_reg(A_MTLR,NR_R0));
+                    a_reg_dealloc(list,NR_R0);
                   end;
 
 (*

+ 0 - 3
compiler/powerpc/cpubase.pas

@@ -237,9 +237,6 @@ uses
                                 Reference
 *****************************************************************************}
 
-    const
-      symaddr2str: array[trefaddr] of string[3] = ('','','@ha','@l','');
-
     const
       { MacOS only. Whether the direct data area (TOC) directly contain
         global variables. Otherwise it contains pointers to global variables. }

+ 2 - 2
compiler/powerpc/cpupara.pas

@@ -60,9 +60,9 @@ unit cpupara;
     function tppcparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
       begin
         if (target_info.system = system_powerpc_darwin) then
-          result := [RS_R2..RS_R12]
+          result := [RS_R0,RS_R2..RS_R12]
         else
-          result := [RS_R3..RS_R12];
+          result := [RS_R0,RS_R3..RS_R12];
       end;
 
 

+ 2 - 2
compiler/powerpc/nppccal.pas

@@ -89,10 +89,10 @@ implementation
 
                   reference_reset(tmpref);
                   tmpref.symbol:=current_asmdata.RefAsmSymbol(tstaticvarsym(tprocdef(procdefinition).libsym).mangledname);
-                  tmpref.refaddr:=addr_hi;
+                  tmpref.refaddr:=addr_higha;
                   current_asmdata.CurrAsmList.concat(taicpu.op_reg_ref(A_LIS,NR_R12,tmpref));
                   tmpref.base:=NR_R12;
-                  tmpref.refaddr:=addr_lo;
+                  tmpref.refaddr:=addr_low;
                   current_asmdata.CurrAsmList.concat(taicpu.op_reg_ref(A_LWZ,NR_R12,tmpref));
 
                   reference_reset_base(tmpref,NR_R12,-tprocdef(procdefinition).extnumber);

+ 5 - 3
compiler/powerpc/rappcgas.pas

@@ -103,9 +103,11 @@ Unit rappcgas;
             if actasmtoken=AS_ID then
               begin
                 if upper(actasmpattern)='L' then
-                  oper.opr.ref.refaddr:=addr_lo
+                  oper.opr.ref.refaddr:=addr_low
+                else if upper(actasmpattern)='HI' then
+                  oper.opr.ref.refaddr:=addr_high
                 else if upper(actasmpattern)='HA' then
-                  oper.opr.ref.refaddr:=addr_hi
+                  oper.opr.ref.refaddr:=addr_higha
                 else
                   Message(asmr_e_invalid_reference_syntax);
                 Consume(AS_ID);
@@ -651,7 +653,7 @@ Unit rappcgas;
             dec(ord(hs[0]));
             actcondition.dirhint:=DH_Plus;
           end;
-	actopcode := tasmop(ptrint(iasmops.find(hs)));
+	actopcode := tasmop(ptruint(iasmops.find(hs)));
         if actopcode <> A_NONE then
           begin
             if actcondition.dirhint<>DH_None then

+ 13 - 27
compiler/powerpc64/cgcpu.pas

@@ -397,15 +397,15 @@ begin
   if (target_info.system <> system_powerpc64_darwin) then
     // r13 is tls, do not use, r2 is not available
     rg[R_INTREGISTER] := trgcpu.create(R_INTREGISTER, R_SUBWHOLE,
-      [RS_R3, RS_R4, RS_R5, RS_R6, RS_R7, RS_R8,
+      [{$ifdef user0} RS_R0, {$endif} RS_R3, RS_R4, RS_R5, RS_R6, RS_R7, RS_R8,
        RS_R9, RS_R10, RS_R11, RS_R12, RS_R31, RS_R30, RS_R29,
        RS_R28, RS_R27, RS_R26, RS_R25, RS_R24, RS_R23, RS_R22,
        RS_R21, RS_R20, RS_R19, RS_R18, RS_R17, RS_R16, RS_R15,
        RS_R14], first_int_imreg, [])
   else
     { special for darwin/ppc64: r2 available volatile, r13 = tls }
-    rg[R_INTREGISTER] := trgcpu.create(R_INTREGISTER, R_SUBWHOLE,
-      [RS_R2, RS_R3, RS_R4, RS_R5, RS_R6, RS_R7, RS_R8,
+    rg[R_INTREGISTER] := trgintcpu.create(R_INTREGISTER, R_SUBWHOLE,
+      [{$ifdef user0} RS_R0, {$endif} RS_R2, RS_R3, RS_R4, RS_R5, RS_R6, RS_R7, RS_R8,
         RS_R9, RS_R10, RS_R11, RS_R12, RS_R31, RS_R30, RS_R29,
         RS_R28, RS_R27, RS_R26, RS_R25, RS_R24, RS_R23, RS_R22,
        RS_R21, RS_R20, RS_R19, RS_R18, RS_R17, RS_R16, RS_R15,
@@ -544,7 +544,7 @@ end;
 procedure tcgppc.a_call_name(list: TAsmList; const s: string);
 begin
     if (target_info.system <> system_powerpc64_darwin) then
-      a_call_name_direct(list, s, true, true)
+      a_call_name_direct(list, s, false, true)
     else
       begin
         list.concat(taicpu.op_sym(A_BL,get_darwin_call_stub(s)));
@@ -714,11 +714,11 @@ begin
   if not (size in [OS_8, OS_S8, OS_16, OS_S16, OS_32, OS_S32, OS_64, OS_S64]) then
     internalerror(2002090902);
   { if PIC or basic optimizations are enabled, and the number of instructions which would be
-   required to load the value is greater than 2, store (and later load) the value from there }
-  if (((cs_opt_peephole in current_settings.optimizerswitches) or (cs_create_pic in current_settings.moduleswitches)) and
-    (getInstructionLength(a) > 2)) then
-    loadConstantPIC(list, size, a, reg)
-  else
+   required to load the value is greater than 2, store (and later load) the value from there } 
+//  if (((cs_opt_peephole in current_settings.optimizerswitches) or (cs_create_pic in current_settings.moduleswitches)) and
+//    (getInstructionLength(a) > 2)) then
+//    loadConstantPIC(list, size, a, reg)
+//  else
     loadConstantNormal(list, size, a, reg);
 end;
 
@@ -1903,15 +1903,7 @@ var
   ref: treference;
   symname : string;
 begin
-  maybe_new_object_file(current_asmdata.asmlists[al_picdata]);
-  symname := '_$' + current_asmdata.name + '$got$' + symbol;
-  l:=current_asmdata.getasmsymbol(symname);
-  if not(assigned(l)) then begin
-    l:=current_asmdata.DefineAsmSymbol(symname, AB_COMMON, AT_DATA);
-    current_asmdata.asmlists[al_picdata].concat(tai_section.create(sec_toc, '.toc', 8));
-    current_asmdata.asmlists[al_picdata].concat(tai_symbol.create_global(l,0));
-    current_asmdata.asmlists[al_picdata].concat(tai_directive.create(asd_toc_entry, symbol + '[TC], ' + symbol));
-  end;
+  l:=current_asmdata.getasmsymbol(symbol);
   reference_reset_symbol(ref,l,0);
   ref.base := NR_R2;
   ref.refaddr := addr_pic;
@@ -1926,10 +1918,6 @@ end;
 
 
 function tcgppc.fixref(list: TAsmList; var ref: treference): boolean;
-  { symbol names must not be larger than this to be able to make a GOT reference out of them,
-   otherwise they get truncated by the compiler resulting in failing of the assembling stage }
-const
-  MAX_GOT_SYMBOL_NAME_LENGTH_HACK = 120;
 var
   tmpreg: tregister;
   name : string;
@@ -1958,12 +1946,10 @@ begin
       ref.symbol := nil;
     end;
 
-
   { if we have to create PIC, add the symbol to the TOC/GOT }
-  {$WARNING Hack for avoiding too long manglednames enabled!!}
   if (target_info.system <> system_powerpc64_darwin) and
-     (cs_create_pic in current_settings.moduleswitches) and (assigned(ref.symbol) and
-    (length(ref.symbol.name) < MAX_GOT_SYMBOL_NAME_LENGTH_HACK)) then begin
+     (cs_create_pic in current_settings.moduleswitches) and 
+     (assigned(ref.symbol)) then begin
     tmpreg := load_got_symbol(list, ref.symbol.name);
     if (ref.base = NR_NO) then
       ref.base := tmpreg
@@ -2177,7 +2163,7 @@ begin
   end;
   reference_reset_symbol(ref,l,0);
   ref.base := NR_R2;
-  ref.refaddr := addr_pic;
+  ref.refaddr := addr_no;
 
   {$IFDEF EXTDEBUG}
   list.concat(tai_comment.create(strpnew('loading value from TOC reference for ' + symname)));

+ 0 - 3
compiler/powerpc64/cpubase.pas

@@ -250,9 +250,6 @@ type
                               Reference
 *****************************************************************************}
 
-const
-  symaddr2str: array[trefaddr] of string[9] = ('', '', 'ha16','lo16','', '@l', '@h', '@higher', '@highest', '@ha', '@highera', '@highesta');
-
 const
   { MacOS only. Whether the direct data area (TOC) directly contain
     global variables. Otherwise it contains pointers to global variables. }

+ 1 - 1
compiler/powerpc64/cpupara.pas

@@ -68,7 +68,7 @@ uses
 function tppcparamanager.get_volatile_registers_int(calloption:
   tproccalloption): tcpuregisterset;
 begin
-  result := [RS_R3..RS_R12];
+  result := [RS_R0,RS_R3..RS_R12];
   if (target_info.system = system_powerpc64_darwin) then
     include(result,RS_R2);
 end;

+ 3 - 9
compiler/powerpc64/rappcgas.pas

@@ -118,15 +118,9 @@ begin
         Message(asmr_e_invalid_reference_syntax);
 
       { darwin/ppc64's relocation symbols are 32 bits }
-      if (target_info.system = system_powerpc64_darwin) then
-        case oper.opr.ref.refaddr of
-          addr_low:
-            oper.opr.ref.refaddr:=addr_lo;
-          addr_higha:
-            oper.opr.ref.refaddr:=addr_hi;
-          else if (oper.opr.ref.refaddr<>addr_no) then
-            Message(asmr_e_invalid_reference_syntax);
-        end;
+      if (target_info.system = system_powerpc64_darwin) and
+        (not (oper.opr.ref.refaddr in [addr_no, addr_low, addr_higha])) then
+        Message(asmr_e_invalid_reference_syntax);
 
       Consume(AS_ID);
     end

+ 5 - 5
compiler/ppcgen/aasmcpu.pas

@@ -96,8 +96,8 @@ uses
     procedure DoneAsm;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
 
     procedure fixup_jmps(list: TAsmList);
 
@@ -396,7 +396,7 @@ uses cutils, cclasses;
           A_STW, A_STWX,
           A_STFS, A_STFSX, A_STFD, A_STFDX, A_STFIWX, A_STHBRX, A_STWBRX, A_STWCX_,
           A_CMP, A_CMPI, A_CMPL, A_CMPLI,
-          A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ,
+          A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ, A_DCBF, A_ICBI,
           A_ECOWX, A_FCMPO, A_FCMPU, A_MTMSR, A_TLBIE, A_TW, A_TWI,
           A_CMPWI, A_CMPW, A_CMPLWI, A_CMPLW, A_MT, A_MTLR, A_MTCTR
 {$ifdef cpu64bit}
@@ -436,7 +436,7 @@ uses cutils, cclasses;
       end;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER:
@@ -453,7 +453,7 @@ uses cutils, cclasses;
       end;
 
 
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER:

+ 11 - 7
compiler/ppcgen/agppcgas.pas

@@ -69,14 +69,14 @@ unit agppcgas;
 
 {$ifdef cpu64bit}
     const
-      refaddr2str: array[trefaddr] of string[9] = ('', '', 'ha16','lo16','', '@l', '@h', '@higher', '@highest', '@ha', '@highera', '@highesta');
-      verbose_refaddrs = [addr_lo,addr_hi,addr_low, addr_high, addr_higher, addr_highest, addr_higha, addr_highera, addr_highesta];
-      refaddr2str_darwin: array[trefaddr] of string[4] = ('','','ha16','lo16','','@err', '@err', '@err', '@err', '@err', '@err', '@err');
+      refaddr2str: array[trefaddr] of string[9] = ('', '', '', '@l', '@h', '@higher', '@highest', '@ha', '@highera', '@highesta');
+      verbose_refaddrs = [addr_low, addr_high, addr_higher, addr_highest, addr_higha, addr_highera, addr_highesta];
+      refaddr2str_darwin: array[trefaddr] of string[4] = ('','','','lo16', 'hi16', '@err', '@err', 'ha16', '@err', '@err');
 {$else cpu64bit}
     const
-      refaddr2str: array[trefaddr] of string[3] = ('','','@ha','@l','');
-      refaddr2str_darwin: array[trefaddr] of string[4] = ('','','ha16','lo16','');
-      verbose_refaddrs = [addr_lo,addr_hi];
+      refaddr2str: array[trefaddr] of string[3] = ('','','','@l','@h','@ha');
+      refaddr2str_darwin: array[trefaddr] of string[4] = ('','','','lo16','hi16','ha16');
+      verbose_refaddrs = [addr_low,addr_high,addr_higha];
 {$endif cpu64bit}
 
 
@@ -123,7 +123,11 @@ unit agppcgas;
                  s := s+refaddr2str[refaddr];
              end;
 {$ifdef cpu64bit}
-           if (refaddr = addr_pic) then s := s + ')';
+           if (refaddr = addr_pic) then
+	     if (target_info.system <> system_powerpc64_linux) then
+	       s := s + ')'
+	     else
+	       s := s + ')@got';
 {$endif cpu64bit}
 
            if (index=NR_NO) and (base<>NR_NO) then

+ 6 - 7
compiler/ppcgen/cgppc.pas

@@ -170,9 +170,9 @@ unit cgppc;
         current_asmdata.asmlists[al_imports].concat(tai_directive.create(asd_indirect_symbol,s));
         l1 := current_asmdata.RefAsmSymbol('L'+s+'$lazy_ptr');
         reference_reset_symbol(href,l1,0);
-        href.refaddr := addr_hi;
+        href.refaddr := addr_higha;
         current_asmdata.asmlists[al_imports].concat(taicpu.op_reg_ref(A_LIS,NR_R11,href));
-        href.refaddr := addr_lo;
+        href.refaddr := addr_low;
         href.base := NR_R11;
 {$ifndef cpu64bit}
         current_asmdata.asmlists[al_imports].concat(taicpu.op_reg_ref(A_LWZU,NR_R12,href));
@@ -240,7 +240,7 @@ unit cgppc;
                  tmpref.offset := ref2.offset;
                  tmpref.symbol := ref2.symbol;
                  tmpref.relsymbol := ref2.relsymbol;
-                 tmpref.refaddr := addr_hi;
+                 tmpref.refaddr := addr_higha;
                  if ref2.base<> NR_NO then
                    begin
                      list.concat(taicpu.op_reg_reg_ref(A_ADDIS,r,
@@ -249,7 +249,7 @@ unit cgppc;
                  else
                    list.concat(taicpu.op_reg_ref(A_LIS,r,tmpref));
                  tmpref.base := NR_NO;
-                 tmpref.refaddr := addr_lo;
+                 tmpref.refaddr := addr_low;
                  { can be folded with one of the next instructions by the }
                  { optimizer probably                                     }
                  list.concat(taicpu.op_reg_reg_ref(A_ADDI,r,r,tmpref));
@@ -483,7 +483,6 @@ unit cgppc;
   procedure tcgppcgen.g_profilecode(list: TAsmList);
     var
       paraloc1 : tcgpara;
-      reg: tregister;
     begin
       if (target_info.system in [system_powerpc_darwin]) then
         begin
@@ -688,14 +687,14 @@ unit cgppc;
                 tmpref.symbol := ref.symbol;
                 tmpref.relsymbol := ref.relsymbol;
                 tmpref.offset := ref.offset;
-                tmpref.refaddr := addr_hi;
+                tmpref.refaddr := addr_higha;
                 if ref.base <> NR_NO then
                   list.concat(taicpu.op_reg_reg_ref(A_ADDIS,tmpreg,
                     ref.base,tmpref))
                 else
                   list.concat(taicpu.op_reg_ref(A_LIS,tmpreg,tmpref));
                 ref.base := tmpreg;
-                ref.refaddr := addr_lo;
+                ref.refaddr := addr_low;
                 list.concat(taicpu.op_reg_ref(op,reg,ref));
               end
             else

+ 86 - 13
compiler/ppcgen/rgcpu.pas

@@ -39,6 +39,12 @@ unit rgcpu;
          procedure do_spill_written(list:TAsmList;pos:tai;const spilltemp:treference;tempreg:tregister);override;
        end;
 
+       trgintcpu = class(trgcpu)
+{$ifdef user0}
+         procedure add_cpu_interferences(p : tai);override;
+{$endif user0}
+       end;
+
   implementation
 
     uses
@@ -51,8 +57,8 @@ unit rgcpu;
       var
         tmpref : treference;
         helplist : TAsmList;
-        l : tasmlabel;
         hreg : tregister;
+        ins : Taicpu;
       begin
         if (spilltemp.offset<low(smallint)) or
            (spilltemp.offset>high(smallint)) then
@@ -63,18 +69,30 @@ unit rgcpu;
               internalerror(200704201);
 
             if getregtype(tempreg)=R_INTREGISTER then
-              hreg:=getregisterinline(helplist,R_SUBWHOLE)
+              begin
+                hreg:=getregisterinline(helplist,R_SUBWHOLE);
+                {Done by add_cpu_interferences now.
+                add_edge(getsupreg(hreg),RS_R0);}
+              end
             else
               hreg:=cg.getintregister(helplist,OS_ADDR);
+
             reference_reset(tmpref);
             tmpref.offset:=spilltemp.offset;
-            tmpref.refaddr:=addr_hi;
-            helplist.concat(taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref));
+            tmpref.refaddr := addr_higha;
+            ins:=taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref);
+            add_cpu_interferences(ins);
+            helplist.concat(ins);
             tmpref:=spilltemp;
-            tmpref.refaddr:=addr_lo;
+            tmpref.refaddr := addr_low;
             tmpref.base:=hreg;
-            helplist.concat(spilling_create_load(tmpref,tempreg));
-
+	    
+            ins:=spilling_create_load(tmpref,tempreg);
+            add_cpu_interferences(ins);
+	    
+	    
+            helplist.concat(ins);
+	    
             if getregtype(tempreg)=R_INTREGISTER then
               ungetregisterinline(helplist,hreg);
 
@@ -90,8 +108,8 @@ unit rgcpu;
       var
         tmpref : treference;
         helplist : TAsmList;
-        l : tasmlabel;
         hreg : tregister;
+        ins : Taicpu;
       begin
         if (spilltemp.offset<low(smallint)) or
            (spilltemp.offset>high(smallint)) then
@@ -102,17 +120,25 @@ unit rgcpu;
               internalerror(200704201);
 
             if getregtype(tempreg)=R_INTREGISTER then
-              hreg:=getregisterinline(helplist,R_SUBWHOLE)
+              begin
+                hreg:=getregisterinline(helplist,R_SUBWHOLE);
+                {Done by add_cpu_interferences now.
+                add_edge(getsupreg(hreg),RS_R0);}
+              end
             else
               hreg:=cg.getintregister(helplist,OS_ADDR);
             reference_reset(tmpref);
             tmpref.offset:=spilltemp.offset;
-            tmpref.refaddr:=addr_hi;
-            helplist.concat(taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref));
+            tmpref.refaddr := addr_higha;
+            ins:=taicpu.op_reg_reg_ref(A_ADDIS,hreg,spilltemp.base,tmpref);
+            add_cpu_interferences(ins);
+            helplist.concat(ins);
             tmpref:=spilltemp;
-            tmpref.refaddr:=addr_lo;
+            tmpref.refaddr := addr_low;
             tmpref.base:=hreg;
-            helplist.concat(spilling_create_store(tempreg,tmpref));
+            ins:=spilling_create_store(tempreg,tmpref);
+            add_cpu_interferences(ins);
+            helplist.concat(ins);
 
             if getregtype(tempreg)=R_INTREGISTER then
               ungetregisterinline(helplist,hreg);
@@ -124,4 +150,51 @@ unit rgcpu;
           inherited do_spill_written(list,pos,spilltemp,tempreg);
       end;
 
+{$ifdef user0}
+    procedure trgintcpu.add_cpu_interferences(p : tai);
+      var
+        r : tregister;
+      begin
+        if p.typ=ait_instruction then
+          begin
+            case taicpu(p).opcode of
+              A_ADDI, A_ADDIS,
+              A_STB, A_LBZ, A_STBX, A_LBZX, A_STH, A_LHZ, A_STHX, A_LHZX, A_LHA, A_LHAX,
+              A_STW, A_LWZ, A_STWX, A_LWZX,
+              A_STFS, A_LFS, A_STFSX, A_LFSX, A_STFD, A_LFD, A_STFDX, A_LFDX, A_STFIWX,
+              A_STHBRX, A_LHBRX, A_STWBRX, A_LWBRX, A_STWCX_, A_LWARX,
+              A_ECIWX, A_ECOWX,
+              A_LMW, A_STMW,A_LSWI,A_LSWX,A_STSWI,A_STSWX
+{$ifdef cpu64bit}
+              , A_STD, A_STDX,
+              A_LD, A_LDX,
+              A_LWA, A_LWAX,
+              A_STDCX_,A_LDARX
+{$endif cpu64bit}
+                :
+                begin
+                  case taicpu(p).oper[1]^.typ of
+                    top_reg:
+                      add_edge(getsupreg(taicpu(p).oper[1]^.reg),RS_R0);
+                    top_ref:
+                      if (taicpu(p).oper[1]^.ref^.base <> NR_NO) then
+                        add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);
+                  end;
+                end;
+              A_DCBA, A_DCBI, A_DCBST, A_DCBT, A_DCBTST, A_DCBZ, A_DCBF, A_ICBI:
+                begin
+                  case taicpu(p).oper[0]^.typ of
+                    top_reg:
+                      add_edge(getsupreg(taicpu(p).oper[0]^.reg),RS_R0);
+                    top_ref:
+                      if (taicpu(p).oper[0]^.ref^.base <> NR_NO) then
+                        add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),RS_R0);
+                  end;
+                end;
+            end;
+          end;
+      end;
+{$endif user0}
+
+
 end.

+ 0 - 3
compiler/ppu.pas

@@ -1038,9 +1038,6 @@ procedure tppufile.putsmallset(const b);
 procedure tppufile.putnormalset(const b);
   type
     SetLongintArray = Array [0..7] of longint;
-  var
-    i : longint;
-    tempb : setlongintarray;
   begin
     putdata(b,32);
   end;

+ 17 - 5
compiler/rgobj.pas

@@ -1787,14 +1787,24 @@ unit rgobj;
 
 
     procedure Trgobj.do_spill_read(list:TAsmList;pos:tai;const spilltemp:treference;tempreg:tregister);
+
+    var ins:Taicpu;
+
       begin
-        list.insertafter(spilling_create_load(spilltemp,tempreg),pos);
+        ins:=spilling_create_load(spilltemp,tempreg);
+        add_cpu_interferences(ins);
+        list.insertafter(ins,pos);
       end;
 
 
     procedure Trgobj.do_spill_written(list:TAsmList;pos:tai;const spilltemp:treference;tempreg:tregister);
+
+    var ins:Taicpu;
+
       begin
-        list.insertafter(spilling_create_store(tempreg,spilltemp),pos);
+        ins:=spilling_create_store(tempreg,spilltemp);
+        add_cpu_interferences(ins);
+        list.insertafter(ins,pos);
       end;
 
 
@@ -2048,8 +2058,7 @@ unit rgobj;
 
         { substitute registers }
         for counter:=0 to instr.ops-1 do
-         with instr.oper[counter]^ do
-          begin
+          with instr.oper[counter]^ do
             case typ of
               top_reg:
                 begin
@@ -2072,7 +2081,10 @@ unit rgobj;
                 end;
 {$endif ARM}
             end;
-          end;
+         {We have modified the instruction; perhaps the new instruction has
+          certain constraints regarding which imaginary registers interfere
+          with certain physical registers.}
+         add_cpu_interferences(instr);
       end;
 
 end.

+ 5 - 5
compiler/sparc/aasmcpu.pas

@@ -75,8 +75,8 @@ uses
     procedure InitAsm;
     procedure DoneAsm;
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
 
 implementation
 
@@ -185,7 +185,7 @@ implementation
       begin
          inherited create(op);
          { only allowed to load the address }
-         if not(_op2.refaddr in [addr_lo,addr_hi]) then
+         if not(_op2.refaddr in [addr_low,addr_high]) then
            internalerror(200305311);
          ops:=3;
          loadreg(0,_op1);
@@ -259,7 +259,7 @@ implementation
       end;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :
@@ -281,7 +281,7 @@ implementation
       end;
 
 
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :

+ 5 - 5
compiler/sparc/cgcpu.pas

@@ -187,17 +187,17 @@ implementation
             reference_reset(tmpref);
             tmpref.symbol:=ref.symbol;
             tmpref.offset:=ref.offset;
-            tmpref.refaddr:=addr_hi;
+            tmpref.refaddr:=addr_high;
             list.concat(taicpu.op_ref_reg(A_SETHI,tmpref,tmpreg));
             if (ref.offset=0) and (ref.index=NR_NO) and
               (ref.base=NR_NO) then
               begin
-                ref.refaddr:=addr_lo;
+                ref.refaddr:=addr_low;
               end
             else
               begin
                 { Load the low part is left }
-                tmpref.refaddr:=addr_lo;
+                tmpref.refaddr:=addr_low;
                 list.concat(taicpu.op_reg_ref_reg(A_OR,tmpreg,tmpref,tmpreg));
                 ref.offset:=0;
                 { symbol is loaded }
@@ -636,10 +636,10 @@ implementation
             reference_reset(tmpref);
             tmpref.symbol := href.symbol;
             tmpref.offset := href.offset;
-            tmpref.refaddr := addr_hi;
+            tmpref.refaddr := addr_high;
             list.concat(taicpu.op_ref_reg(A_SETHI,tmpref,hreg));
             { Only the low part is left }
-            tmpref.refaddr:=addr_lo;
+            tmpref.refaddr:=addr_low;
             list.concat(taicpu.op_reg_ref_reg(A_OR,hreg,tmpref,hreg));
             if href.base<>NR_NO then
               begin

+ 5 - 5
compiler/sparc/cpugas.pas

@@ -70,9 +70,9 @@ implementation
                  else if offset<0 then
                    GetReferenceString:=GetReferenceString+ToStr(offset);
                  case refaddr of
-                   addr_hi:
+                   addr_high:
                      GetReferenceString:='%hi('+GetReferenceString+')';
-                   addr_lo:
+                   addr_low:
                      GetReferenceString:='%lo('+GetReferenceString+')';
                  end;
               end
@@ -80,7 +80,7 @@ implementation
               begin
 {$ifdef extdebug}
                 if assigned(symbol) and
-                  not(refaddr in [addr_pic,addr_lo]) then
+                  not(refaddr in [addr_pic,addr_low]) then
                   internalerror(2003052601);
 {$endif extdebug}
                 if base<>NR_NO then
@@ -99,7 +99,7 @@ implementation
                     }
                     if assigned(symbol) then
                       begin
-                        if refaddr=addr_lo then
+                        if refaddr=addr_low then
                           GetReferenceString:='%lo('+symbol.name+')+'+GetReferenceString
                         else
                           GetReferenceString:=symbol.name+'+'+GetReferenceString;
@@ -127,7 +127,7 @@ implementation
             top_const:
               getopstr:=tostr(longint(val));
             top_ref:
-              if (oper.ref^.refaddr in [addr_no,addr_pic]) or ((oper.ref^.refaddr=addr_lo) and ((oper.ref^.base<>NR_NO) or
+              if (oper.ref^.refaddr in [addr_no,addr_pic]) or ((oper.ref^.refaddr=addr_low) and ((oper.ref^.base<>NR_NO) or
                 (oper.ref^.index<>NR_NO))) then
                 getopstr:='['+getreferencestring(ref^)+']'
               else

+ 4 - 4
compiler/sparc/racpugas.pas

@@ -105,9 +105,9 @@ Interface
             if actasmtoken=AS_ID then
               begin
                 if upper(actasmpattern)='LO' then
-                  oper.opr.ref.refaddr:=addr_lo
+                  oper.opr.ref.refaddr:=addr_low
                 else if upper(actasmpattern)='HI' then
-                  oper.opr.ref.refaddr:=addr_hi
+                  oper.opr.ref.refaddr:=addr_high
                 else
                   Message(asmr_e_invalid_reference_syntax);
                 Consume(AS_ID);
@@ -352,9 +352,9 @@ Interface
                   memory location) }
                 oper.InitRef;
                 if actasmtoken=AS_LO then
-                  oper.opr.ref.refaddr:=addr_lo
+                  oper.opr.ref.refaddr:=addr_low
                 else
-                  oper.opr.ref.refaddr:=addr_hi;
+                  oper.opr.ref.refaddr:=addr_high;
                 Consume(actasmtoken);
                 Consume(AS_LPAREN);
                 BuildConstSymbolExpression(false, true,false,l,tempstr,tempsymtyp);

+ 4 - 4
compiler/sparc/rgcpu.pas

@@ -104,10 +104,10 @@ implementation
 
             reference_reset(tmpref);
             tmpref.offset:=spilltemp.offset;
-            tmpref.refaddr:=addr_hi;
+            tmpref.refaddr:=addr_high;
             helplist.concat(taicpu.op_ref_reg(A_SETHI,tmpref,hreg));
 
-            tmpref.refaddr:=addr_lo;
+            tmpref.refaddr:=addr_low;
             helplist.concat(taicpu.op_reg_ref_reg(A_OR,hreg,tmpref,hreg));
 
             reference_reset_base(tmpref,hreg,0);
@@ -140,10 +140,10 @@ implementation
 
             reference_reset(tmpref);
             tmpref.offset:=spilltemp.offset;
-            tmpref.refaddr:=addr_hi;
+            tmpref.refaddr:=addr_high;
             helplist.concat(taicpu.op_ref_reg(A_SETHI,tmpref,hreg));
 
-            tmpref.refaddr:=addr_lo;
+            tmpref.refaddr:=addr_low;
             helplist.concat(taicpu.op_reg_ref_reg(A_OR,hreg,tmpref,hreg));
 
             reference_reset_base(tmpref,hreg,0);

+ 4 - 4
compiler/x86/aasmcpu.pas

@@ -262,8 +262,8 @@ interface
          function  FindInsentry(objdata:TObjData):boolean;
       end;
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
 
     procedure InitAsm;
     procedure DoneAsm;
@@ -2376,7 +2376,7 @@ implementation
       end;
 
 
-    function spilling_create_load(const ref:treference;r:tregister): tai;
+    function spilling_create_load(const ref:treference;r:tregister):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :
@@ -2398,7 +2398,7 @@ implementation
       end;
 
 
-    function spilling_create_store(r:tregister; const ref:treference): tai;
+    function spilling_create_store(r:tregister; const ref:treference):Taicpu;
       begin
         case getregtype(r) of
           R_INTREGISTER :