Ver Fonte

* initialisation of global mm register variables

git-svn-id: trunk@206 -
florian há 20 anos atrás
pai
commit
cf2c0d52e3
2 ficheiros alterados com 6 adições e 2 exclusões
  1. 1 1
      compiler/nadd.pas
  2. 5 1
      compiler/ncgutil.pas

+ 1 - 1
compiler/nadd.pas

@@ -104,7 +104,7 @@ implementation
             if t2.def.deftype=floatdef then
               begin
                 { when a comp or currency is used, use always the
-                  best type to calculate the result }
+                  best float type to calculate the result }
                 if (tfloatdef(t2.def).typ in [s64comp,s64currency]) or
                   (tfloatdef(t2.def).typ in [s64comp,s64currency]) then
                   result:=pbestrealtype^

+ 5 - 1
compiler/ncgutil.pas

@@ -837,7 +837,11 @@ implementation
                    tglobalvarsym(p).localloc.register);
              LOC_REFERENCE : ;
              LOC_CMMREGISTER :
-               ;
+               { clear the whole register }
+               cg.a_opmm_reg_reg(taasmoutput(arg),OP_XOR,reg_cgsize(tglobalvarsym(p).localloc.register),
+                 tglobalvarsym(p).localloc.register,
+                 tglobalvarsym(p).localloc.register,
+                 nil);
              LOC_CFPUREGISTER :
                ;
              else