From 78977be7521171521bcec384ef4c0bb3fedb0420 Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 14 Sep 1999 07:59:46 +0000 Subject: [PATCH] * finally!? fixed with do My last and also Peter's fix before were wrong :( --- compiler/cg386mem.pas | 28 +++++++++++++++++++++++++--- compiler/cgai386.pas | 8 ++++++-- compiler/tccal.pas | 9 ++++++++- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/compiler/cg386mem.pas b/compiler/cg386mem.pas index ab2a197e1c..45f9df73b5 100644 --- a/compiler/cg386mem.pas +++ b/compiler/cg386mem.pas @@ -781,7 +781,7 @@ implementation procedure secondwith(var p : ptree); var - usetemp : boolean; + usetemp,with_expr_in_temp : boolean; begin if assigned(p^.left) then begin @@ -811,10 +811,24 @@ implementation end else begin - emit_lea_loc_reg(p^.left^.location,R_EDI,true); + emit_lea_loc_reg(p^.left^.location,R_EDI,false); usetemp:=true; end; + release_loc(p^.left^.location); + + { if the with expression is stored in a temp } + { area we must make it persistent and shouldn't } + { release it (FK) } + if (p^.left^.location.loc in [LOC_MEM,LOC_REFERENCE]) and + istemp(p^.left^.location.reference) then + begin + normaltemptopersistant(p^.left^.location.reference.offset); + with_expr_in_temp:=true; + end + else + with_expr_in_temp:=false; + { if usetemp is set the value must be in %edi } if usetemp then begin @@ -833,6 +847,9 @@ implementation if usetemp then ungetpersistanttemp(p^.withreference^.offset); + if with_expr_in_temp then + ungetpersistanttemp(p^.left^.location.reference.offset); + dispose(p^.withreference); p^.withreference:=nil; end; @@ -842,7 +859,12 @@ implementation end. { $Log$ - Revision 1.56 1999-09-13 20:49:41 florian + Revision 1.57 1999-09-14 07:59:46 florian + * finally!? fixed + with do + My last and also Peter's fix before were wrong :( + + Revision 1.56 1999/09/13 20:49:41 florian * hopefully an error in Peter's previous commit fixed Revision 1.55 1999/09/10 15:42:50 peter diff --git a/compiler/cgai386.pas b/compiler/cgai386.pas index 85f18b4d35..b52a6607e3 100644 --- a/compiler/cgai386.pas +++ b/compiler/cgai386.pas @@ -488,7 +488,6 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister); emit_ref_reg(A_MOV,S_L, newreference(t.reference),reg); end; - ungetiftemp(t.reference); end; else internalerror(330); @@ -3350,7 +3349,12 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister); end. { $Log$ - Revision 1.41 1999-09-12 08:48:04 florian + Revision 1.42 1999-09-14 07:59:47 florian + * finally!? fixed + with do + My last and also Peter's fix before were wrong :( + + Revision 1.41 1999/09/12 08:48:04 florian * bugs 593 and 607 fixed * some other potential bugs with array constructors fixed * for classes compiled in $M+ and it's childs, the default access method diff --git a/compiler/tccal.pas b/compiler/tccal.pas index c75638b6da..09bc6ae40b 100644 --- a/compiler/tccal.pas +++ b/compiler/tccal.pas @@ -1122,6 +1122,8 @@ implementation p^.location.loc:=LOC_FPU; p^.registersfpu:=1; end + else + p^.location.loc:=LOC_MEM; end; end; must_be_valid:=store_valid; @@ -1217,7 +1219,12 @@ implementation end. { $Log$ - Revision 1.63 1999-09-10 18:48:11 florian + Revision 1.64 1999-09-14 07:59:48 florian + * finally!? fixed + with do + My last and also Peter's fix before were wrong :( + + Revision 1.63 1999/09/10 18:48:11 florian * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid) * most things for stored properties fixed