mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:09:25 +02:00
* 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 -
This commit is contained in:
parent
2f72f67f11
commit
61af0fb72d
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user