浏览代码

--- Merging r30757 into '.':
U compiler/generic/symcpu.pas
U compiler/arm/symcpu.pas
U compiler/symtable.pas
U compiler/ia64/symcpu.pas
U compiler/m68k/symcpu.pas
U compiler/powerpc64/symcpu.pas
U compiler/symconst.pas
U compiler/mips/symcpu.pas
U compiler/x86_64/symcpu.pas
U compiler/i8086/symcpu.pas
U compiler/powerpc/symcpu.pas
U compiler/avr/symcpu.pas
U compiler/symsym.pas
U compiler/i386/symcpu.pas
U compiler/alpha/symcpu.pas
U compiler/jvm/symcpu.pas
U compiler/sparc/symcpu.pas
U compiler/pmodules.pas
U compiler/aarch64/symcpu.pas
U rtl/inc/text.inc
--- Recording mergeinfo for merge of r30757 into '.':
U .

# revisions: 30757
------------------------------------------------------------------------
r30757 | florian | 2015-05-01 22:58:31 +0200 (vr, 01 mei 2015) | 3 lines
Changed paths:
M /trunk/compiler/aarch64/symcpu.pas
M /trunk/compiler/alpha/symcpu.pas
M /trunk/compiler/arm/symcpu.pas
M /trunk/compiler/avr/symcpu.pas
M /trunk/compiler/generic/symcpu.pas
M /trunk/compiler/i386/symcpu.pas
M /trunk/compiler/i8086/symcpu.pas
M /trunk/compiler/ia64/symcpu.pas
M /trunk/compiler/jvm/symcpu.pas
M /trunk/compiler/m68k/symcpu.pas
M /trunk/compiler/mips/symcpu.pas
M /trunk/compiler/pmodules.pas
M /trunk/compiler/powerpc/symcpu.pas
M /trunk/compiler/powerpc64/symcpu.pas
M /trunk/compiler/sparc/symcpu.pas
M /trunk/compiler/symconst.pas
M /trunk/compiler/symsym.pas
M /trunk/compiler/symtable.pas
M /trunk/compiler/x86_64/symcpu.pas
M /trunk/rtl/inc/text.inc

o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
* variable must be declared again
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_0@33408 -

marco 9 年之前
父节点
当前提交
5f8057775b

+ 4 - 0
compiler/aarch64/symcpu.pas

@@ -94,6 +94,9 @@ type
   tcpuunitsym = class(tunitsym)
   tcpuunitsym = class(tunitsym)
   end;
   end;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
 
 
@@ -162,6 +165,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/alpha/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/arm/symcpu.pas

@@ -119,6 +119,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -199,6 +203,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/avr/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/generic/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/i386/symcpu.pas

@@ -124,6 +124,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -250,6 +254,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/i8086/symcpu.pas

@@ -150,6 +150,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -458,6 +462,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/ia64/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/jvm/symcpu.pas

@@ -144,6 +144,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -914,6 +918,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/m68k/symcpu.pas

@@ -124,6 +124,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -249,6 +253,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/mips/symcpu.pas

@@ -117,6 +117,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -197,6 +201,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 2 - 4
compiler/pmodules.pas

@@ -1907,7 +1907,7 @@ type
          resources_used : boolean;
          resources_used : boolean;
          program_name : ansistring;
          program_name : ansistring;
          consume_semicolon_after_uses : boolean;
          consume_semicolon_after_uses : boolean;
-         ps : tstaticvarsym;
+         ps : tprogramparasym;
          paramnum : longint;
          paramnum : longint;
          textsym : ttypesym;
          textsym : ttypesym;
          sc : array of TProgramParam;
          sc : array of TProgramParam;
@@ -2062,10 +2062,8 @@ type
                internalerror(2013011201);
                internalerror(2013011201);
              for i:=0 to high(sc) do
              for i:=0 to high(sc) do
                begin
                begin
-                 ps:=cstaticvarsym.create(sc[i].name,vs_value,textsym.typedef,[]);
-                 ps.isoindex:=sc[i].nr;
+                 ps:=cprogramparasym.create(sc[i].name,sc[i].nr);
                  current_module.localsymtable.insert(ps,true);
                  current_module.localsymtable.insert(ps,true);
-                 cnodeutils.insertbssdata(tstaticvarsym(ps));
                end;
                end;
            end;
            end;
 
 

+ 5 - 0
compiler/powerpc/symcpu.pas

@@ -124,6 +124,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -249,6 +253,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/powerpc64/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 5 - 0
compiler/sparc/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 3 - 3
compiler/symconst.pas

@@ -577,7 +577,7 @@ type
     staticvarsym,localvarsym,paravarsym,fieldvarsym,
     staticvarsym,localvarsym,paravarsym,fieldvarsym,
     typesym,procsym,unitsym,constsym,enumsym,
     typesym,procsym,unitsym,constsym,enumsym,
     errorsym,syssym,labelsym,absolutevarsym,propertysym,
     errorsym,syssym,labelsym,absolutevarsym,propertysym,
-    macrosym,namespacesym,undefinedsym
+    macrosym,namespacesym,undefinedsym,programparasym
   );
   );
 
 
   { State of the variable:
   { State of the variable:
@@ -696,11 +696,11 @@ inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has
    pushleftright_pocalls : tproccalloptions = [pocall_register,pocall_pascal];
    pushleftright_pocalls : tproccalloptions = [pocall_register,pocall_pascal];
 {$endif}
 {$endif}
 
 
-     SymTypeName : array[tsymtyp] of string[12] = (
+     SymTypeName : array[tsymtyp] of string[14] = (
        'abstractsym','globalvar','localvar','paravar','fieldvar',
        'abstractsym','globalvar','localvar','paravar','fieldvar',
        'type','proc','unit','const','enum',
        'type','proc','unit','const','enum',
        'errorsym','system sym','label','absolutevar','property',
        'errorsym','system sym','label','absolutevar','property',
-       'macrosym','namespace','undefinedsym'
+       'macrosym','namespace','undefinedsym','programparasym'
      );
      );
 
 
      typName : array[tdeftyp] of string[12] = (
      typName : array[tdeftyp] of string[12] = (

+ 40 - 1
compiler/symsym.pas

@@ -89,6 +89,17 @@ interface
        end;
        end;
        tunitsymclass = class of tunitsym;
        tunitsymclass = class of tunitsym;
 
 
+       tprogramparasym = class(Tstoredsym)
+          isoindex : dword;
+          constructor create(const n : string;i : dword);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);
+          destructor destroy;override;
+          { do not override this routine in platform-specific subclasses,
+            override ppuwrite_platform instead }
+          procedure ppuwrite(ppufile:tcompilerppufile);override;final;
+       end;
+       tprogramparasymclass = class of tprogramparasym;
+
        tnamespacesym = class(Tstoredsym)
        tnamespacesym = class(Tstoredsym)
           unitsym:tsym;
           unitsym:tsym;
           unitsymderef:tderef;
           unitsymderef:tderef;
@@ -448,6 +459,7 @@ interface
 
 
        clabelsym: tlabelsymclass;
        clabelsym: tlabelsymclass;
        cunitsym: tunitsymclass;
        cunitsym: tunitsymclass;
+       cprogramparasym: tprogramparasymclass;
        cnamespacesym: tnamespacesymclass;
        cnamespacesym: tnamespacesymclass;
        cprocsym: tprocsymclass;
        cprocsym: tprocsymclass;
        ctypesym: ttypesymclass;
        ctypesym: ttypesymclass;
@@ -522,7 +534,6 @@ implementation
           Message1(sym_w_non_implemented_symbol,srsym.realname);
           Message1(sym_w_non_implemented_symbol,srsym.realname);
       end;
       end;
 
 
-
 {****************************************************************************
 {****************************************************************************
                           TSYM (base for all symtypes)
                           TSYM (base for all symtypes)
 ****************************************************************************}
 ****************************************************************************}
@@ -681,6 +692,34 @@ implementation
          writeentry(ppufile,ibunitsym);
          writeentry(ppufile,ibunitsym);
       end;
       end;
 
 
+{****************************************************************************
+                             TPROGRAMPARASYM
+****************************************************************************}
+
+    constructor tprogramparasym.create(const n : string; i : dword);
+      begin
+         inherited create(programparasym,n);
+         isoindex:=i;
+      end;
+
+    constructor tprogramparasym.ppuload(ppufile : tcompilerppufile);
+      begin
+        { program parameter syms (iso pascal style) might be never written to a ppu }
+        internalerror(2015050102);
+      end;
+
+    destructor tprogramparasym.destroy;
+      begin
+       inherited destroy;
+      end;
+
+    procedure tprogramparasym.ppuwrite(ppufile : tcompilerppufile);
+      begin
+        { program parameter syms (iso pascal style) might be never written to a ppu }
+        internalerror(2015050101);
+      end;
+
+
 {****************************************************************************
 {****************************************************************************
                                 TNAMESPACESYM
                                 TNAMESPACESYM
 ****************************************************************************}
 ****************************************************************************}

+ 8 - 0
compiler/symtable.pas

@@ -1705,6 +1705,14 @@ implementation
                 if sym.typ=symconst.namespacesym then
                 if sym.typ=symconst.namespacesym then
                   tnamespacesym(sym).unitsym:=tsym(hsym);
                   tnamespacesym(sym).unitsym:=tsym(hsym);
               end
               end
+            { iso mode program parameters: staticvarsyms might have the same name as a program parameters,
+              in this case, copy the isoindex and make the original symbol invisible }
+            else if (m_iso in current_settings.modeswitches) and (hsym.typ=programparasym) and (sym.typ=staticvarsym)
+              and (tstaticvarsym(hsym).isoindex<>0) then
+              begin
+                HideSym(hsym);
+                tstaticvarsym(sym).isoindex:=tprogramparasym(hsym).isoindex;
+              end
             else
             else
               DuplicateSym(hashedid,sym,hsym,false);
               DuplicateSym(hashedid,sym,hsym,false);
             result:=true;
             result:=true;

+ 5 - 0
compiler/x86_64/symcpu.pas

@@ -115,6 +115,10 @@ type
   end;
   end;
   tcpuunitsymclass = class of tcpuunitsym;
   tcpuunitsymclass = class of tcpuunitsym;
 
 
+  tcpuprogramparasym = class(tprogramparasym)
+  end;
+  tcpuprogramparasymclass = class(tprogramparasym);
+
   tcpunamespacesym = class(tnamespacesym)
   tcpunamespacesym = class(tnamespacesym)
   end;
   end;
   tcpunamespacesymclass = class of tcpunamespacesym;
   tcpunamespacesymclass = class of tcpunamespacesym;
@@ -195,6 +199,7 @@ begin
   { used tsym classes }
   { used tsym classes }
   clabelsym:=tcpulabelsym;
   clabelsym:=tcpulabelsym;
   cunitsym:=tcpuunitsym;
   cunitsym:=tcpuunitsym;
+  cprogramparasym:=tcpuprogramparasym;
   cnamespacesym:=tcpunamespacesym;
   cnamespacesym:=tcpunamespacesym;
   cprocsym:=tcpuprocsym;
   cprocsym:=tcpuprocsym;
   ctypesym:=tcputypesym;
   ctypesym:=tcputypesym;

+ 2 - 4
rtl/inc/text.inc

@@ -646,12 +646,10 @@ begin
   assign(t,paramstr(nr));
   assign(t,paramstr(nr));
 {$else FPC_HAS_FEATURE_COMMANDARGS}
 {$else FPC_HAS_FEATURE_COMMANDARGS}
   { primitive workaround for targets supporting no command line arguments,
   { primitive workaround for targets supporting no command line arguments,
-    invent some file name, this will be fixed later on anways because
-    the current way of handling iso program parameters is apparently
-    wrong }
+    invent some file name, try to avoid complex procedures like concating strings which might
+    pull-in bigger parts of the rtl }
   assign(t,chr((nr mod 16)+65));
   assign(t,chr((nr mod 16)+65));
 {$endif FPC_HAS_FEATURE_COMMANDARGS}
 {$endif FPC_HAS_FEATURE_COMMANDARGS}
-  reset(t);
 end;
 end;