Parcourir la source

* don't set varsym.localloc anymore in gen_alloc_regvar(): in most cases
initialloc was already set afterwards, now it's also done in the final
case (and allocating the initial location should be different from
setting the current location)

git-svn-id: trunk@34085 -

Jonas Maebe il y a 9 ans
Parent
commit
fb0f4394c0
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      compiler/ncgutil.pas

+ 4 - 2
compiler/ncgutil.pas

@@ -773,7 +773,6 @@ implementation
         else
         else
           varloc:=tai_varloc.create(sym,sym.initialloc.register);
           varloc:=tai_varloc.create(sym,sym.initialloc.register);
         list.concat(varloc);
         list.concat(varloc);
-        sym.localloc:=sym.initialloc;
       end;
       end;
 
 
 
 
@@ -1324,7 +1323,10 @@ implementation
             { gen_load_cgpara_loc() already allocated the initialloc
             { gen_load_cgpara_loc() already allocated the initialloc
               -> don't allocate again }
               -> don't allocate again }
             if currpara.initialloc.loc in [LOC_CREGISTER,LOC_CFPUREGISTER,LOC_CMMREGISTER] then
             if currpara.initialloc.loc in [LOC_CREGISTER,LOC_CFPUREGISTER,LOC_CMMREGISTER] then
-              gen_alloc_regvar(list,currpara,false);
+              begin
+                gen_alloc_regvar(list,currpara,false);
+                hlcg.varsym_set_localloc(list,currpara);
+              end;
           end;
           end;
 
 
         { generate copies of call by value parameters, must be done before
         { generate copies of call by value parameters, must be done before