Browse Source

* hnewn reg allocation corrected

pierre 26 years ago
parent
commit
cf18a314d1
1 changed files with 11 additions and 3 deletions
  1. 11 3
      compiler/tccal.pas

+ 11 - 3
compiler/tccal.pas

@@ -1109,7 +1109,9 @@ implementation
                           is_ansistring(p^.resulttype) then
                           is_ansistring(p^.resulttype) then
                           begin
                           begin
                              p^.location.loc:=LOC_MEM;
                              p^.location.loc:=LOC_MEM;
-                             p^.registers32:=0;
+                             { this is wrong we still need one register  PM
+                             p^.registers32:=0; }
+                             p^.registers32:=1;
                           end;
                           end;
                      end
                      end
                    else if (p^.resulttype^.deftype=floatdef) then
                    else if (p^.resulttype^.deftype=floatdef) then
@@ -1127,7 +1129,10 @@ implementation
            begin
            begin
               case p^.methodpointer^.treetype of
               case p^.methodpointer^.treetype of
                 { but only, if this is not a supporting node }
                 { but only, if this is not a supporting node }
-                typen,hnewn : ;
+                typen: ;
+                { we need one register for new return value PM }
+                hnewn : if p^.registers32=0 then
+                          p^.registers32:=1;
                 else
                 else
                   begin
                   begin
                      if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
                      if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
@@ -1208,7 +1213,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  1999-08-17 13:26:08  peter
+  Revision 1.62  1999-08-23 23:42:52  pierre
+   * hnewn reg allocation corrected
+
+  Revision 1.61  1999/08/17 13:26:08  peter
     * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
     * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
       variant.
       variant.