Browse Source

Merged revisions 7988 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r7988 | yury | 2007-07-09 16:27:19 +0300 (Пн, 09 июл 2007) | 1 line

* Initialize fpu regvars from staticsymtable by loading initial value from memory location.
........

git-svn-id: branches/fixes_2_2@8005 -

yury 18 years ago
parent
commit
ac11ecabdb
1 changed files with 9 additions and 1 deletions
  1. 9 1
      compiler/ncgutil.pas

+ 9 - 1
compiler/ncgutil.pas

@@ -1018,6 +1018,8 @@ implementation
 
 
     { initializes the regvars from staticsymtable with 0 }
     { initializes the regvars from staticsymtable with 0 }
     procedure initialize_regvars(p:TObject;arg:pointer);
     procedure initialize_regvars(p:TObject;arg:pointer);
+      var
+        href : treference;
       begin
       begin
         if (tsym(p).typ=staticvarsym) then
         if (tsym(p).typ=staticvarsym) then
          begin
          begin
@@ -1041,7 +1043,13 @@ implementation
                  tstaticvarsym(p).initialloc.register,
                  tstaticvarsym(p).initialloc.register,
                  nil);
                  nil);
              LOC_CFPUREGISTER :
              LOC_CFPUREGISTER :
-               ;
+               begin
+                 { initialize fpu regvar by loading from memory }              
+                 reference_reset_symbol(href,
+                   current_asmdata.RefAsmSymbol(tstaticvarsym(p).mangledname), 0);
+                 cg.a_loadfpu_ref_reg(TAsmList(arg), tstaticvarsym(p).initialloc.size,
+                   tstaticvarsym(p).initialloc.size, href, tstaticvarsym(p).initialloc.register);
+               end;
              LOC_INVALID :
              LOC_INVALID :
                ;
                ;
              else
              else