mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 10:29:08 +02:00
* some fixes for handling parameters passed on the stack
git-svn-id: trunk@30545 -
This commit is contained in:
parent
90e4581814
commit
1ef7e36f3c
@ -313,24 +313,23 @@ unit cgcpu;
|
|||||||
|
|
||||||
for i:=1 to tcgsize2size[paraloc.Size] do
|
for i:=1 to tcgsize2size[paraloc.Size] do
|
||||||
begin
|
begin
|
||||||
if not(assigned(hp)) or
|
if not(assigned(hp)) then
|
||||||
(tcgsize2size[hp^.size]<>1) or
|
|
||||||
(hp^.shiftval<>0) then
|
|
||||||
internalerror(2014011105);
|
internalerror(2014011105);
|
||||||
case hp^.loc of
|
case hp^.loc of
|
||||||
LOC_REGISTER,LOC_CREGISTER:
|
LOC_REGISTER,LOC_CREGISTER:
|
||||||
a_load_const_reg(list,hp^.size,(a shr (8*(i-1))) and $ff,hp^.register);
|
|
||||||
LOC_REFERENCE,LOC_CREFERENCE:
|
|
||||||
begin
|
begin
|
||||||
list.concat(taicpu.op_const(A_PUSH,(a shr (8*(i-1))) and $ff));
|
if (tcgsize2size[hp^.size]<>1) or
|
||||||
|
(hp^.shiftval<>0) then
|
||||||
|
internalerror(2015041101);
|
||||||
|
a_load_const_reg(list,hp^.size,(a shr (8*(i-1))) and $ff,hp^.register);
|
||||||
|
hp:=hp^.Next;
|
||||||
end;
|
end;
|
||||||
|
LOC_REFERENCE,LOC_CREFERENCE:
|
||||||
|
list.concat(taicpu.op_const(A_PUSH,(a shr (8*(i-1))) and $ff));
|
||||||
else
|
else
|
||||||
internalerror(2002071004);
|
internalerror(2002071004);
|
||||||
end;
|
end;
|
||||||
hp:=hp^.Next;
|
|
||||||
end;
|
end;
|
||||||
if assigned(hp) then
|
|
||||||
internalerror(2014011104);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,11 +324,6 @@ unit cpupara;
|
|||||||
else
|
else
|
||||||
internalerror(2005082901);
|
internalerror(2005082901);
|
||||||
end
|
end
|
||||||
else if paracgsize<>OS_S8 then
|
|
||||||
begin
|
|
||||||
paraloc^.size:=OS_8;
|
|
||||||
paraloc^.def:=u8inttype
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
paraloc^.size:=paracgsize;
|
paraloc^.size:=paracgsize;
|
||||||
@ -340,6 +335,8 @@ unit cpupara;
|
|||||||
if nextintreg>=RS_R8 then
|
if nextintreg>=RS_R8 then
|
||||||
begin
|
begin
|
||||||
paraloc^.loc:=LOC_REGISTER;
|
paraloc^.loc:=LOC_REGISTER;
|
||||||
|
paraloc^.size:=OS_8;
|
||||||
|
paraloc^.def:=u8inttype;
|
||||||
paraloc^.register:=newreg(R_INTREGISTER,nextintreg,R_SUBWHOLE);
|
paraloc^.register:=newreg(R_INTREGISTER,nextintreg,R_SUBWHOLE);
|
||||||
inc(nextintreg);
|
inc(nextintreg);
|
||||||
end
|
end
|
||||||
@ -349,9 +346,9 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
LOC_REFERENCE:
|
LOC_REFERENCE:
|
||||||
begin
|
begin
|
||||||
paraloc^.size:=OS_ADDR;
|
|
||||||
if push_addr_param(hp.varspez,paradef,p.proccalloption) then
|
if push_addr_param(hp.varspez,paradef,p.proccalloption) then
|
||||||
begin
|
begin
|
||||||
|
paraloc^.size:=OS_ADDR;
|
||||||
paraloc^.def:=getpointerdef(paradef);
|
paraloc^.def:=getpointerdef(paradef);
|
||||||
assignintreg
|
assignintreg
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user