* fixed for the fix of bug #793

* fpu variables modified by nested subroutines aren't regable anymore
  * $maxfpuregisters doesn't modify anymore the behavior of a procedure before
This commit is contained in:
florian 2000-01-21 22:06:16 +00:00
parent b38526bfea
commit eb1715ded4
3 changed files with 28 additions and 10 deletions

View File

@ -720,7 +720,7 @@ implementation
begin begin
{ it's no bad idea, to insert the VMT } { it's no bad idea, to insert the VMT }
emit_sym(A_PUSH,S_L,newasmsymbol( emit_sym(A_PUSH,S_L,newasmsymbol(
pobjectdef(p^.methodpointer^.resulttype)^.vmt_mangledname)); procinfo^._class^.vmt_mangledname));
end end
{ destructors haven't to dispose the instance, if this is } { destructors haven't to dispose the instance, if this is }
{ a direct call } { a direct call }
@ -1333,7 +1333,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.119 2000-01-21 12:17:41 jonas Revision 1.120 2000-01-21 22:06:16 florian
* fixed for the fix of bug 793
* fpu variables modified by nested subroutines aren't regable anymore
* $maxfpuregisters doesn't modify anymore the behavior of a procedure before
Revision 1.119 2000/01/21 12:17:41 jonas
* regallocation fixes * regallocation fixes
Revision 1.118 2000/01/20 12:14:47 florian Revision 1.118 2000/01/20 12:14:47 florian

View File

@ -1366,6 +1366,7 @@ var
_class,hp:Pobjectdef; _class,hp:Pobjectdef;
{ switches can change inside the procedure } { switches can change inside the procedure }
entryswitches, exitswitches : tlocalswitches; entryswitches, exitswitches : tlocalswitches;
oldaktmaxfpuregisters,localmaxfpuregisters : longint;
{ code for the subroutine as tree } { code for the subroutine as tree }
{$ifdef newcg} {$ifdef newcg}
code:pnode; code:pnode;
@ -1456,6 +1457,7 @@ begin
{ save entry info } { save entry info }
entrypos:=aktfilepos; entrypos:=aktfilepos;
entryswitches:=aktlocalswitches; entryswitches:=aktlocalswitches;
localmaxfpuregisters:=aktmaxfpuregisters;
{$ifdef newcg} {$ifdef newcg}
{ parse the code ... } { parse the code ... }
if (po_assembler in aktprocsym^.definition^.procoptions) then if (po_assembler in aktprocsym^.definition^.procoptions) then
@ -1498,6 +1500,8 @@ begin
{ ... and generate assembler } { ... and generate assembler }
{ but set the right switches for entry !! } { but set the right switches for entry !! }
aktlocalswitches:=entryswitches; aktlocalswitches:=entryswitches;
oldaktmaxfpuregisters:=aktmaxfpuregisters;
aktmaxfpuregisters:=localmaxfpuregisters;
{$ifndef NOPASS2} {$ifndef NOPASS2}
{$ifdef newcg} {$ifdef newcg}
tg.setfirsttemp(procinfo^.firsttemp_offset); tg.setfirsttemp(procinfo^.firsttemp_offset);
@ -1636,6 +1640,8 @@ begin
while symtablestack^.symtabletype=objectsymtable do while symtablestack^.symtabletype=objectsymtable do
symtablestack:=symtablestack^.next; symtablestack:=symtablestack^.next;
aktmaxfpuregisters:=oldaktmaxfpuregisters;
{ restore filepos, the switches are already set } { restore filepos, the switches are already set }
aktfilepos:=savepos; aktfilepos:=savepos;
{ restore labels } { restore labels }
@ -1939,7 +1945,12 @@ end.
{ {
$Log$ $Log$
Revision 1.42 2000-01-16 22:17:12 peter Revision 1.43 2000-01-21 22:06:16 florian
* fixed for the fix of bug 793
* fpu variables modified by nested subroutines aren't regable anymore
* $maxfpuregisters doesn't modify anymore the behavior of a procedure before
Revision 1.42 2000/01/16 22:17:12 peter
* renamed call_offset to para_offset * renamed call_offset to para_offset
Revision 1.41 2000/01/11 17:16:06 jonas Revision 1.41 2000/01/11 17:16:06 jonas

View File

@ -118,11 +118,8 @@ implementation
begin begin
p^.registers32:=1; p^.registers32:=1;
{ further, the variable can't be put into a register } { further, the variable can't be put into a register }
{$ifdef INCLUDEOK} pvarsym(p^.symtableentry)^.varoptions:=
exclude(pvarsym(p^.symtableentry)^.varoptions,vo_regable); pvarsym(p^.symtableentry)^.varoptions-[vo_fpuregable,vo_regable];
{$else}
pvarsym(p^.symtableentry)^.varoptions:=pvarsym(p^.symtableentry)^.varoptions-[vo_regable];
{$endif}
end; end;
end; end;
if (pvarsym(p^.symtableentry)^.varspez=vs_const) then if (pvarsym(p^.symtableentry)^.varspez=vs_const) then
@ -481,7 +478,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.57 2000-01-07 01:14:46 peter Revision 1.58 2000-01-21 22:06:16 florian
* fixed for the fix of bug 793
* fpu variables modified by nested subroutines aren't regable anymore
* $maxfpuregisters doesn't modify anymore the behavior of a procedure before
Revision 1.57 2000/01/07 01:14:46 peter
* updated copyright to 2000 * updated copyright to 2000
Revision 1.56 2000/01/06 01:08:59 pierre Revision 1.56 2000/01/06 01:08:59 pierre
@ -603,4 +605,4 @@ end.
- empty array constructors are now handled correctly (e.g. for sysutils.format) - empty array constructors are now handled correctly (e.g. for sysutils.format)
- comparsion of ansistrings was sometimes coded wrong - comparsion of ansistrings was sometimes coded wrong
} }