mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 11:06:19 +02:00
* fixed paralocation for integer var/out parameters
This commit is contained in:
parent
06e03ecd23
commit
fd1056c621
@ -126,6 +126,7 @@ unit cpupara;
|
|||||||
|
|
||||||
var
|
var
|
||||||
nextintreg,nextfloatreg,nextmmreg : tregister;
|
nextintreg,nextfloatreg,nextmmreg : tregister;
|
||||||
|
paradef : tdef;
|
||||||
stack_offset : aword;
|
stack_offset : aword;
|
||||||
hp : tparaitem;
|
hp : tparaitem;
|
||||||
loc : tloc;
|
loc : tloc;
|
||||||
@ -170,12 +171,16 @@ unit cpupara;
|
|||||||
hp:=tparaitem(p.para.last);
|
hp:=tparaitem(p.para.last);
|
||||||
while assigned(hp) do
|
while assigned(hp) do
|
||||||
begin
|
begin
|
||||||
loc:=getparaloc(hp.paratype.def);
|
if (hp.paratyp in [vs_var,vs_out]) then
|
||||||
|
paradef := voidpointertype.def
|
||||||
|
else
|
||||||
|
paradef := hp.paratype.def;
|
||||||
|
loc:=getparaloc(paradef);
|
||||||
hp.paraloc.sp_fixup:=0;
|
hp.paraloc.sp_fixup:=0;
|
||||||
case loc of
|
case loc of
|
||||||
LOC_REGISTER:
|
LOC_REGISTER:
|
||||||
begin
|
begin
|
||||||
hp.paraloc.size := def_cgsize(hp.paratype.def);
|
hp.paraloc.size := def_cgsize(paradef);
|
||||||
{ for things like formaldef }
|
{ for things like formaldef }
|
||||||
if hp.paraloc.size = OS_NO then
|
if hp.paraloc.size = OS_NO then
|
||||||
hp.paraloc.size := OS_ADDR;
|
hp.paraloc.size := OS_ADDR;
|
||||||
@ -206,25 +211,9 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
LOC_FPUREGISTER:
|
LOC_FPUREGISTER:
|
||||||
begin
|
begin
|
||||||
if hp.paratyp in [vs_var,vs_out] then
|
if nextfloatreg.enum<=R_F10 then
|
||||||
begin
|
begin
|
||||||
if nextintreg.number<=NR_R10 then
|
hp.paraloc.size:=def_cgsize(paradef);
|
||||||
begin
|
|
||||||
hp.paraloc.size:=OS_ADDR;
|
|
||||||
hp.paraloc.loc:=LOC_REGISTER;
|
|
||||||
hp.paraloc.register:=nextintreg;
|
|
||||||
inc(nextintreg.number,NR_R1-NR_R0);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
{!!!!!!!}
|
|
||||||
hp.paraloc.size:=def_cgsize(hp.paratype.def);
|
|
||||||
internalerror(2002071006);
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else if nextfloatreg.enum<=R_F10 then
|
|
||||||
begin
|
|
||||||
hp.paraloc.size:=def_cgsize(hp.paratype.def);
|
|
||||||
hp.paraloc.loc:=LOC_FPUREGISTER;
|
hp.paraloc.loc:=LOC_FPUREGISTER;
|
||||||
hp.paraloc.register:=nextfloatreg;
|
hp.paraloc.register:=nextfloatreg;
|
||||||
inc(nextfloatreg.enum);
|
inc(nextfloatreg.enum);
|
||||||
@ -232,17 +221,16 @@ unit cpupara;
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{!!!!!!!}
|
{!!!!!!!}
|
||||||
hp.paraloc.size:=def_cgsize(hp.paratype.def);
|
hp.paraloc.size:=def_cgsize(paradef);
|
||||||
internalerror(2002071004);
|
internalerror(2002071004);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
LOC_REFERENCE:
|
LOC_REFERENCE:
|
||||||
begin
|
begin
|
||||||
hp.paraloc.size:=OS_ADDR;
|
hp.paraloc.size:=OS_ADDR;
|
||||||
if push_addr_param(hp.paratype.def,p.proccalloption) or
|
if push_addr_param(paradef,p.proccalloption) or
|
||||||
is_open_array(hp.paratype.def) or
|
is_open_array(paradef) or
|
||||||
is_array_of_const(hp.paratype.def) or
|
is_array_of_const(paradef) then
|
||||||
(hp.paratyp in [vs_var,vs_out]) then
|
|
||||||
assignintreg
|
assignintreg
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -313,7 +301,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.23 2003-03-11 21:46:24 jonas
|
Revision 1.24 2003-04-16 07:55:07 jonas
|
||||||
|
* fixed paralocation for integer var/out parameters
|
||||||
|
|
||||||
|
Revision 1.23 2003/03/11 21:46:24 jonas
|
||||||
* lots of new regallocator fixes, both in generic and ppc-specific code
|
* lots of new regallocator fixes, both in generic and ppc-specific code
|
||||||
(ppc compiler still can't compile the linux system unit though)
|
(ppc compiler still can't compile the linux system unit though)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user