Преглед на файлове

* only take into account the location of the parameter at the callee side to
determine whether it's in a register if it's a pure assembler routine
* you can't "index" implicit pointers either using their fields

git-svn-id: trunk@36287 -

Jonas Maebe преди 8 години
родител
ревизия
61af0fb72d

+ 5 - 3
compiler/aarch64/racpugas.pas

@@ -55,7 +55,7 @@ Unit racpugas;
       globtype,verbose,
       systems,aasmbase,aasmtai,aasmdata,aasmcpu,
       { symtable }
-      symconst,symsym,
+      symconst,symsym,symdef,
       procinfo,
       rabase,rautils,
       cgbase,cgutils,paramgr;
@@ -609,8 +609,10 @@ Unit racpugas;
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 5 - 3
compiler/arm/raarmgas.pas

@@ -65,7 +65,7 @@ Unit raarmgas;
       globtype,globals,verbose,
       systems,aasmbase,aasmtai,aasmdata,aasmcpu,
       { symtable }
-      symconst,symsym,
+      symconst,symsym,symdef,
       procinfo,
       rabase,rautils,
       cgbase,cgutils,paramgr;
@@ -636,8 +636,10 @@ Unit raarmgas;
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 5 - 3
compiler/avr/raavrgas.pas

@@ -53,7 +53,7 @@ Unit raavrgas;
       { aasm }
       cpuinfo,aasmbase,aasmtai,aasmdata,aasmcpu,
       { symtable }
-      symconst,symbase,symtype,symsym,symtable,
+      symconst,symbase,symtype,symsym,symtable,symdef,
       { parser }
       scanner,
       procinfo,
@@ -260,8 +260,10 @@ Unit raavrgas;
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 5 - 3
compiler/mips/racpugas.pas

@@ -53,7 +53,7 @@ Interface
       { aasm }
       cpubase,aasmbase,aasmtai,aasmdata,aasmcpu,
       { symtable }
-      symconst,symsym,
+      symconst,symsym,symdef,
       { parser }
       scanner,
       procinfo,
@@ -169,8 +169,10 @@ Interface
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 4 - 2
compiler/powerpc/rappcgas.pas

@@ -341,8 +341,10 @@ Unit rappcgas;
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 4 - 2
compiler/powerpc64/rappcgas.pas

@@ -351,8 +351,10 @@ var
           if hasdot and
             (not oper.hastype) and
             (oper.opr.localsym.typ=paravarsym) and
-            ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-             not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+            (not(po_assembler in current_procinfo.procdef.procoptions) or
+             (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+             (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+              not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
             Message(asmr_e_cannot_access_field_directly_for_parameters);
           inc(oper.opr.localsymofs, l)
         end;

+ 5 - 3
compiler/sparc/racpugas.pas

@@ -52,7 +52,7 @@ Interface
       { aasm }
       cpubase,aasmbase,aasmtai,aasmdata,aasmcpu,
       { symtable }
-      symconst,symsym,
+      symconst,symsym,symdef,
       { parser }
       scanner,
       procinfo,
@@ -222,8 +222,10 @@ Interface
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l)
                 end;

+ 5 - 3
compiler/x86/rax86att.pas

@@ -63,7 +63,7 @@ Implementation
       { aasm }
       aasmbase,aasmdata,aasmcpu,
       { symtable }
-      symconst,symsym,
+      symconst,symsym,symdef,
       { parser }
       scanner,
       procinfo,
@@ -461,8 +461,10 @@ Implementation
                   if hasdot and
                      (not oper.hastype) and
                      (oper.opr.localsym.typ=paravarsym) and
-                     ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                      not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                     (not(po_assembler in current_procinfo.procdef.procoptions) or
+                      (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                      (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                       not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                     Message(asmr_e_cannot_access_field_directly_for_parameters);
                   inc(oper.opr.localsymofs,l);
                   inc(oper.opr.localconstoffset,l);

+ 4 - 2
compiler/x86/rax86int.pas

@@ -1738,8 +1738,10 @@ Unit Rax86int;
                           and when the parameter is in a register (delphi compatible) }
                         if (not oper.hastype) and
                            (oper.opr.localsym.typ=paravarsym) and
-                           ((tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
-                            not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption)) then
+                           (not(po_assembler in current_procinfo.procdef.procoptions) or
+                            (tparavarsym(oper.opr.localsym).paraloc[calleeside].location^.loc<>LOC_REGISTER) or
+                            (not is_implicit_pointer_object_type(oper.opr.localsym.vardef) and
+                             not paramanager.push_addr_param(oper.opr.localsym.varspez,oper.opr.localsym.vardef,current_procinfo.procdef.proccalloption))) then
                           Message(asmr_e_cannot_access_field_directly_for_parameters);
 
                         oper.opr.localforceref:=true;