mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 04:06:08 +02:00
* fix register allocation in second_assert
This commit is contained in:
parent
fc977d3259
commit
494e190694
@ -179,7 +179,7 @@ implementation
|
|||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
procedure tcginlinenode.second_Assert;
|
procedure tcginlinenode.second_Assert;
|
||||||
var
|
var
|
||||||
hp2 : tstringconstnode;
|
hp2,hp3 : tnode;
|
||||||
otlabel,oflabel : tasmlabel;
|
otlabel,oflabel : tasmlabel;
|
||||||
paraloc1,paraloc2,
|
paraloc1,paraloc2,
|
||||||
paraloc3,paraloc4 : tcgpara;
|
paraloc3,paraloc4 : tcgpara;
|
||||||
@ -202,25 +202,31 @@ implementation
|
|||||||
secondpass(tcallparanode(left).left);
|
secondpass(tcallparanode(left).left);
|
||||||
maketojumpbool(exprasmlist,tcallparanode(left).left,lr_load_regvars);
|
maketojumpbool(exprasmlist,tcallparanode(left).left,lr_load_regvars);
|
||||||
cg.a_label(exprasmlist,falselabel);
|
cg.a_label(exprasmlist,falselabel);
|
||||||
{ erroraddr }
|
{ First call secondpass() before we can push the parameters, otherwise
|
||||||
paramanager.allocparaloc(exprasmlist,paraloc4);
|
parameters allocated in the registers can be destroyed }
|
||||||
cg.a_param_reg(exprasmlist,OS_ADDR,NR_FRAME_POINTER_REG,paraloc4);
|
{ generate filename string parameter }
|
||||||
{ lineno }
|
|
||||||
paramanager.allocparaloc(exprasmlist,paraloc3);
|
|
||||||
cg.a_param_const(exprasmlist,OS_INT,aktfilepos.line,paraloc3);
|
|
||||||
{ filename string }
|
|
||||||
hp2:=cstringconstnode.createstr(current_module.sourcefiles.get_file_name(aktfilepos.fileindex),st_shortstring);
|
hp2:=cstringconstnode.createstr(current_module.sourcefiles.get_file_name(aktfilepos.fileindex),st_shortstring);
|
||||||
firstpass(tnode(hp2));
|
firstpass(hp2);
|
||||||
secondpass(tnode(hp2));
|
secondpass(hp2);
|
||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
exit;
|
||||||
|
{ message parameter }
|
||||||
|
hp3:=tcallparanode(tcallparanode(left).right).left;
|
||||||
|
secondpass(hp3);
|
||||||
|
if codegenerror then
|
||||||
|
exit;
|
||||||
|
{ push erroraddr }
|
||||||
|
paramanager.allocparaloc(exprasmlist,paraloc4);
|
||||||
|
cg.a_param_reg(exprasmlist,OS_ADDR,NR_FRAME_POINTER_REG,paraloc4);
|
||||||
|
{ push lineno }
|
||||||
|
paramanager.allocparaloc(exprasmlist,paraloc3);
|
||||||
|
cg.a_param_const(exprasmlist,OS_INT,aktfilepos.line,paraloc3);
|
||||||
|
{ push filename }
|
||||||
paramanager.allocparaloc(exprasmlist,paraloc2);
|
paramanager.allocparaloc(exprasmlist,paraloc2);
|
||||||
cg.a_paramaddr_ref(exprasmlist,hp2.location.reference,paraloc2);
|
cg.a_paramaddr_ref(exprasmlist,hp2.location.reference,paraloc2);
|
||||||
hp2.free;
|
|
||||||
{ push msg }
|
{ push msg }
|
||||||
secondpass(tcallparanode(tcallparanode(left).right).left);
|
|
||||||
paramanager.allocparaloc(exprasmlist,paraloc1);
|
paramanager.allocparaloc(exprasmlist,paraloc1);
|
||||||
cg.a_paramaddr_ref(exprasmlist,tcallparanode(tcallparanode(left).right).left.location.reference,paraloc1);
|
cg.a_paramaddr_ref(exprasmlist,hp3.location.reference,paraloc1);
|
||||||
{ call }
|
{ call }
|
||||||
paramanager.freeparaloc(exprasmlist,paraloc1);
|
paramanager.freeparaloc(exprasmlist,paraloc1);
|
||||||
paramanager.freeparaloc(exprasmlist,paraloc2);
|
paramanager.freeparaloc(exprasmlist,paraloc2);
|
||||||
@ -229,6 +235,8 @@ implementation
|
|||||||
cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
|
cg.alloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
|
||||||
cg.a_call_name(exprasmlist,'FPC_ASSERT');
|
cg.a_call_name(exprasmlist,'FPC_ASSERT');
|
||||||
cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
|
cg.dealloccpuregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
|
||||||
|
location_freetemp(exprasmlist,hp3.location);
|
||||||
|
location_freetemp(exprasmlist,hp2.location);
|
||||||
cg.a_label(exprasmlist,truelabel);
|
cg.a_label(exprasmlist,truelabel);
|
||||||
truelabel:=otlabel;
|
truelabel:=otlabel;
|
||||||
falselabel:=oflabel;
|
falselabel:=oflabel;
|
||||||
@ -236,6 +244,7 @@ implementation
|
|||||||
paraloc2.done;
|
paraloc2.done;
|
||||||
paraloc3.done;
|
paraloc3.done;
|
||||||
paraloc4.done;
|
paraloc4.done;
|
||||||
|
hp2.free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -679,7 +688,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.69 2005-02-14 17:13:06 peter
|
Revision 1.70 2005-04-04 16:04:47 peter
|
||||||
|
* fix register allocation in second_assert
|
||||||
|
|
||||||
|
Revision 1.69 2005/02/14 17:13:06 peter
|
||||||
* truncate log
|
* truncate log
|
||||||
|
|
||||||
Revision 1.68 2005/02/13 18:55:19 florian
|
Revision 1.68 2005/02/13 18:55:19 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user