Bläddra i källkod

* Removed/commented more unused variables.
* Fixed some uninitialized variable warnings.

git-svn-id: trunk@11442 -

yury 17 år sedan
förälder
incheckning
fd0ed50331

+ 3 - 5
compiler/aopt.pas

@@ -71,7 +71,7 @@ Unit aopt;
       { Walks through the paasmlist to find the lowest and highest label number.  }
       { Walks through the paasmlist to find the lowest and highest label number.  }
       { Returns the last Pai object of the current block                          }
       { Returns the last Pai object of the current block                          }
       Var LabelFound: Boolean;
       Var LabelFound: Boolean;
-          p, prev: tai;
+          p: tai;
       Begin
       Begin
         LabelInfo^.LowLabel := High(AWord);
         LabelInfo^.LowLabel := High(AWord);
         LabelInfo^.HighLabel := 0;
         LabelInfo^.HighLabel := 0;
@@ -79,7 +79,6 @@ Unit aopt;
         LabelInfo^.LabelTable:=nil;
         LabelInfo^.LabelTable:=nil;
         LabelFound := False;
         LabelFound := False;
         P := BlockStart;
         P := BlockStart;
-        prev := p;
         With LabelInfo^ Do
         With LabelInfo^ Do
           Begin
           Begin
             While Assigned(P) And
             While Assigned(P) And
@@ -96,7 +95,6 @@ Unit aopt;
                     If (tai_Label(p).labsym.labelnr > HighLabel) Then
                     If (tai_Label(p).labsym.labelnr > HighLabel) Then
                       HighLabel := tai_Label(p).labsym.labelnr
                       HighLabel := tai_Label(p).labsym.labelnr
                   End;
                   End;
-                prev := p;
                 GetNextInstruction(p, p)
                 GetNextInstruction(p, p)
               End;
               End;
             blockend:=p;
             blockend:=p;
@@ -110,10 +108,10 @@ Unit aopt;
     { Builds a table with the locations of the labels in the TAsmList.       }
     { Builds a table with the locations of the labels in the TAsmList.       }
     { Also fixes some RegDeallocs like "# %eax released; push (%eax)"           }
     { Also fixes some RegDeallocs like "# %eax released; push (%eax)"           }
     Var p{, hp1, hp2}: tai;
     Var p{, hp1, hp2}: tai;
-        UsedRegs: TRegSet;
+        {UsedRegs: TRegSet;}
         LabelIdx : longint;
         LabelIdx : longint;
     Begin
     Begin
-      UsedRegs := [];
+      {UsedRegs := [];}
       With LabelInfo^ Do
       With LabelInfo^ Do
         If (LabelDif <> 0) Then
         If (LabelDif <> 0) Then
           Begin
           Begin

+ 3 - 3
compiler/arm/aasmcpu.pas

@@ -1279,8 +1279,8 @@ implementation
        * required to have unspecified size in the instruction too...)
        * required to have unspecified size in the instruction too...)
       }
       }
       var
       var
-        i,{j,}asize{,oprs} : longint;
-        siz : array[0..3] of longint;
+        i{,j,asize,oprs} : longint;
+        {siz : array[0..3] of longint;}
       begin
       begin
         Matches:=100;
         Matches:=100;
         writeln(getstring,'---');
         writeln(getstring,'---');
@@ -1369,8 +1369,8 @@ implementation
         { as default an untyped size can get all the sizes, this is different
         { as default an untyped size can get all the sizes, this is different
           from nasm, but else we need to do a lot checking which opcodes want
           from nasm, but else we need to do a lot checking which opcodes want
           size or not with the automatic size generation }
           size or not with the automatic size generation }
-        asize:=longint($ffffffff);
         (*
         (*
+        asize:=longint($ffffffff);
         if (p^.flags and IF_SB)<>0 then
         if (p^.flags and IF_SB)<>0 then
           asize:=OT_BITS8
           asize:=OT_BITS8
         else if (p^.flags and IF_SW)<>0 then
         else if (p^.flags and IF_SW)<>0 then

+ 1 - 2
compiler/i386/csopt386.pas

@@ -418,7 +418,7 @@ var
   HighFound, OrgRegFound: longint;
   HighFound, OrgRegFound: longint;
   regcounter, regCounter2, tmpreg, base, index: tsuperregister;
   regcounter, regCounter2, tmpreg, base, index: tsuperregister;
   OrgRegResult: Boolean;
   OrgRegResult: Boolean;
-  TmpResult, flagResultsNeeded, stopchecking: Boolean;
+  TmpResult, flagResultsNeeded: Boolean;
 begin {CheckSequence}
 begin {CheckSequence}
   TmpResult := False;
   TmpResult := False;
   FillChar(OrgRegInfo, Sizeof(OrgRegInfo), 0);
   FillChar(OrgRegInfo, Sizeof(OrgRegInfo), 0);
@@ -458,7 +458,6 @@ begin {CheckSequence}
       hp3 := p;
       hp3 := p;
       if checkingprevsequences then
       if checkingprevsequences then
         prevreginfo := reginfo;
         prevreginfo := reginfo;
-      stopchecking := false;
       while (Found <> OldNrofMods) and
       while (Found <> OldNrofMods) and
                                   { old  new }
                                   { old  new }
              InstructionsEquivalent(hp2, hp3, reginfo) and
              InstructionsEquivalent(hp2, hp3, reginfo) and

+ 2 - 2
compiler/i386/daopt386.pas

@@ -451,7 +451,7 @@ procedure AddRegDeallocFor(asml: TAsmList; reg: tregister; p: tai);
 var
 var
   hp1: tai;
   hp1: tai;
   funcResRegs: tregset;
   funcResRegs: tregset;
-  funcResReg: boolean;
+{  funcResReg: boolean;}
 begin
 begin
 { if not(supreg in rg.usableregsint) then
 { if not(supreg in rg.usableregsint) then
     exit;}
     exit;}
@@ -461,7 +461,7 @@ begin
 {  funcResRegs := funcResRegs - rg.usableregsint;}
 {  funcResRegs := funcResRegs - rg.usableregsint;}
 {  funcResRegs := funcResRegs - [RS_EDI];}
 {  funcResRegs := funcResRegs - [RS_EDI];}
 {  funcResRegs := funcResRegs - [RS_EAX,RS_EBX,RS_ECX,RS_EDX,RS_ESI]; }
 {  funcResRegs := funcResRegs - [RS_EAX,RS_EBX,RS_ECX,RS_EDX,RS_ESI]; }
-  funcResReg := getsupreg(reg) in funcresregs;
+{  funcResReg := getsupreg(reg) in funcresregs;}
 
 
   hp1 := p;
   hp1 := p;
 {
 {

+ 2 - 2
compiler/i386/popt386.pas

@@ -111,7 +111,7 @@ begin
           removeLastDeallocForFuncRes(asmL, p);
           removeLastDeallocForFuncRes(asmL, p);
           doFPULoadStoreOpt := true;
           doFPULoadStoreOpt := true;
         end
         end
-      { can't be done because the store operation rounds
+      (* can't be done because the store operation rounds
       else
       else
         { fst can't store an extended value! }
         { fst can't store an extended value! }
         if (taicpu(p).opsize <> S_FX) and
         if (taicpu(p).opsize <> S_FX) and
@@ -123,7 +123,7 @@ begin
             asml.remove(hp1);
             asml.remove(hp1);
             hp1.free;
             hp1.free;
           end
           end
-      }
+      *)
     end;
     end;
 end;
 end;
 
 

+ 1 - 1
compiler/ogcoff.pas

@@ -2776,7 +2776,7 @@ const pemagic : array[0..3] of byte = (
               end;
               end;
             { Read Function name from DLL, prepend _ and terminate with #0 }
             { Read Function name from DLL, prepend _ and terminate with #0 }
             DLLReader.Seek(sechdr.datapos+NameOfs);
             DLLReader.Seek(sechdr.datapos+NameOfs);
-            DLLReader.Read(FuncName[1],sizeof(FuncName)-3);
+            DLLReader.Read((@FuncName[1])^,sizeof(FuncName)-3);
             FuncName[sizeof(FuncName)-1]:=#0;
             FuncName[sizeof(FuncName)-1]:=#0;
             FuncName[0]:=chr(Strlen(@FuncName[1]));
             FuncName[0]:=chr(Strlen(@FuncName[1]));
             readdllproc(DLLName,FuncName);
             readdllproc(DLLName,FuncName);

+ 3 - 3
compiler/ogelf.pas

@@ -64,12 +64,12 @@ interface
        private
        private
          symtabsect,
          symtabsect,
          strtabsect,
          strtabsect,
-         shstrtabsect,
-         gotpcsect,
+         shstrtabsect: TElfObjSection;
+         {gotpcsect,
          gotoffsect,
          gotoffsect,
          goTSect,
          goTSect,
          plTSect,
          plTSect,
-         symsect  : TElfObjSection;
+         symsect   : TElfObjSection;}
          elf32data : TElfObjData;
          elf32data : TElfObjData;
          symidx,
          symidx,
          localsyms : longint;
          localsyms : longint;

+ 5 - 5
compiler/pmodules.pas

@@ -1541,18 +1541,18 @@ implementation
       var
       var
         main_file : tinputfile;
         main_file : tinputfile;
         hp,hp2    : tmodule;
         hp,hp2    : tmodule;
-        finalize_procinfo,
+        {finalize_procinfo,
         init_procinfo,
         init_procinfo,
-        main_procinfo : tcgprocinfo;
+        main_procinfo : tcgprocinfo;}
         force_init_final : boolean;
         force_init_final : boolean;
         uu : tused_unit;
         uu : tused_unit;
       begin
       begin
          Status.IsPackage:=true;
          Status.IsPackage:=true;
          Status.IsExe:=true;
          Status.IsExe:=true;
          parse_only:=false;
          parse_only:=false;
-         main_procinfo:=nil;
+         {main_procinfo:=nil;
          init_procinfo:=nil;
          init_procinfo:=nil;
-         finalize_procinfo:=nil;
+         finalize_procinfo:=nil;}
 
 
          if not RelocSectionSetExplicitly then
          if not RelocSectionSetExplicitly then
            RelocSection:=true;
            RelocSection:=true;
@@ -1645,7 +1645,7 @@ implementation
          { should we force unit initialization? }
          { should we force unit initialization? }
          force_init_final:=tstaticsymtable(current_module.localsymtable).needs_init_final;
          force_init_final:=tstaticsymtable(current_module.localsymtable).needs_init_final;
          if force_init_final then
          if force_init_final then
-           init_procinfo:=gen_implicit_initfinal(uf_init,current_module.localsymtable);
+           {init_procinfo:=gen_implicit_initfinal(uf_init,current_module.localsymtable)};
 
 
          { Add symbol to the exports section for win32 so smartlinking a
          { Add symbol to the exports section for win32 so smartlinking a
            DLL will include the edata section }
            DLL will include the edata section }

+ 2 - 2
compiler/scandir.pas

@@ -1206,10 +1206,10 @@ implementation
     }
     }
     procedure dir_warn;
     procedure dir_warn;
       var
       var
-        warning_string,state : string;
+        state : string;
       begin
       begin
         current_scanner.skipspace;
         current_scanner.skipspace;
-        warning_string:=current_scanner.readid;
+        current_scanner.readid;
         current_scanner.skipspace;
         current_scanner.skipspace;
         state:=current_scanner.readid;
         state:=current_scanner.readid;
         if (upper(state)='ON') then
         if (upper(state)='ON') then

+ 1 - 0
compiler/systems/t_emx.pas

@@ -290,6 +290,7 @@ var tmp1,tmp2,tmp3:string;
     func : string;
     func : string;
 begin
 begin
     aout_init;
     aout_init;
+    func:='';
     tmp2:=func;
     tmp2:=func;
     if profile_flag and not (copy(func,1,4)='_16_') then
     if profile_flag and not (copy(func,1,4)='_16_') then
         begin
         begin

+ 8 - 6
compiler/systems/t_sunos.pas

@@ -232,9 +232,9 @@ Function TLinkersolaris.WriteResponseFile(isdll:boolean) : Boolean;
 Var
 Var
   linkres      : TLinkRes;
   linkres      : TLinkRes;
   i            : longint;
   i            : longint;
-  cprtobj,
+{  cprtobj,
   gprtobj,
   gprtobj,
-  prtobj       : string[80];
+  prtobj       : string[80];}
   HPath        : TCmdStrListItem;
   HPath        : TCmdStrListItem;
   s,s2         : TCmdStr;
   s,s2         : TCmdStr;
   linkdynamic,
   linkdynamic,
@@ -245,12 +245,12 @@ begin
   linkdynamic:=not(SharedLibFiles.empty);
   linkdynamic:=not(SharedLibFiles.empty);
 {  linkdynamic:=false; // da nicht getestet }
 {  linkdynamic:=false; // da nicht getestet }
   linklibc:=(SharedLibFiles.Find('c')<>nil);
   linklibc:=(SharedLibFiles.Find('c')<>nil);
-  prtobj:='prt0';
+{  prtobj:='prt0';
   cprtobj:='cprt0';
   cprtobj:='cprt0';
-  gprtobj:='gprt0';
+  gprtobj:='gprt0';}
   if cs_profile in current_settings.moduleswitches then
   if cs_profile in current_settings.moduleswitches then
    begin
    begin
-     prtobj:=gprtobj;
+{     prtobj:=gprtobj;}
      if not glibc2 then
      if not glibc2 then
       AddSharedLibrary('gmon');
       AddSharedLibrary('gmon');
      AddSharedLibrary('c');
      AddSharedLibrary('c');
@@ -259,7 +259,9 @@ begin
   else
   else
    begin
    begin
      if linklibc then
      if linklibc then
-       prtobj:=cprtobj
+      begin
+{       prtobj:=cprtobj;}
+      end
       else
       else
        AddSharedLibrary('c'); { quick hack: this solaris implementation needs alwys libc }
        AddSharedLibrary('c'); { quick hack: this solaris implementation needs alwys libc }
    end;
    end;

+ 4 - 4
compiler/systems/t_win.pas

@@ -894,14 +894,14 @@ implementation
     procedure TExportLibWin.generatenasmlib;
     procedure TExportLibWin.generatenasmlib;
       var
       var
          hp : texported_item;
          hp : texported_item;
-         p  : pchar;
-         s  : string;
+         {p  : pchar;
+         s  : string;}
       begin
       begin
          new_section(current_asmdata.asmlists[al_exports],sec_code,'',0);
          new_section(current_asmdata.asmlists[al_exports],sec_code,'',0);
          hp:=texported_item(current_module._exports.first);
          hp:=texported_item(current_module._exports.first);
          while assigned(hp) do
          while assigned(hp) do
            begin
            begin
-             case hp.sym.typ of
+{             case hp.sym.typ of
                staticvarsym :
                staticvarsym :
                  s:=tstaticvarsym(hp.sym).mangledname;
                  s:=tstaticvarsym(hp.sym).mangledname;
                procsym :
                procsym :
@@ -910,7 +910,7 @@ implementation
                  s:='';
                  s:='';
              end;
              end;
              p:=strpnew(#9+'export '+s+' '+hp.Name^+' '+tostr(hp.index));
              p:=strpnew(#9+'export '+s+' '+hp.Name^+' '+tostr(hp.index));
-             {current_asmdata.asmlists[al_exports].concat(tai_direct.create(p));}
+             current_asmdata.asmlists[al_exports].concat(tai_direct.create(p));}
              hp:=texported_item(hp.next);
              hp:=texported_item(hp.next);
            end;
            end;
       end;
       end;