瀏覽代碼

* don't overwrite cai_align with tai_align_abstract
* check that tai_align is used and not tai_align_abstract

git-svn-id: trunk@8563 -

peter 18 年之前
父節點
當前提交
582fa79494
共有 2 個文件被更改,包括 12 次插入5 次删除
  1. 8 1
      compiler/aasmtai.pas
  2. 4 4
      compiler/ncgset.pas

+ 8 - 1
compiler/aasmtai.pas

@@ -2303,6 +2303,10 @@ implementation
        begin
           inherited Create;
           typ:=ait_align;
+{$ifdef EXTDEBUG}
+          if upper(classname)='TAI_ALIGN_ABSTRACT' then
+            internalerror(200709191);
+{$endif EXTDEBUG}
           if b in [1,2,4,8,16,32] then
             aligntype := b
           else
@@ -2371,5 +2375,8 @@ implementation
 
 begin
   cai_cpu:=tai_cpu_abstract;
-  cai_align:=tai_align_abstract;
+  { aasmcpu is earlier in the unit order and can
+    already set the cai_align }
+  if not assigned(cai_align) then
+    cai_align:=tai_align_abstract;
 end.

+ 4 - 4
compiler/ncgset.pas

@@ -422,7 +422,7 @@ implementation
                   pleftreg := left.location.register;
 
                   if (opsize >= OS_S8) or { = if signed }
-                     ((left.resultdef.typ=orddef) and 
+                     ((left.resultdef.typ=orddef) and
                       ((torddef(left.resultdef).low < int64(tsetdef(right.resultdef).setbase)) or
                        (torddef(left.resultdef).high > int64(tsetdef(right.resultdef).setmax)))) or
                      ((left.resultdef.typ=enumdef) and
@@ -822,7 +822,7 @@ implementation
          { generate the instruction blocks }
          for i:=0 to blocks.count-1 do
            begin
-              current_asmdata.CurrAsmList.concat(Tai_align_abstract.create(current_settings.alignment.jumpalign));
+              current_asmdata.CurrAsmList.concat(cai_align.create(current_settings.alignment.jumpalign));
               cg.a_label(current_asmdata.CurrAsmList,pcaseblock(blocks[i])^.blocklabel);
               secondpass(pcaseblock(blocks[i])^.statement);
               { don't come back to case line }
@@ -832,7 +832,7 @@ implementation
 {$endif OLDREGVARS}
               cg.a_jmp_always(current_asmdata.CurrAsmList,endlabel);
            end;
-         current_asmdata.CurrAsmList.concat(Tai_align_abstract.create(current_settings.alignment.jumpalign));
+         current_asmdata.CurrAsmList.concat(cai_align.create(current_settings.alignment.jumpalign));
          { ...and the else block }
          cg.a_label(current_asmdata.CurrAsmList,elselabel);
          if assigned(elseblock) then
@@ -842,7 +842,7 @@ implementation
               load_all_regvars(current_asmdata.CurrAsmList);
 {$endif OLDREGVARS}
            end;
-         current_asmdata.CurrAsmList.concat(Tai_align_abstract.create(current_settings.alignment.jumpalign));
+         current_asmdata.CurrAsmList.concat(cai_align.create(current_settings.alignment.jumpalign));
          cg.a_label(current_asmdata.CurrAsmList,endlabel);
 
          { Reset labels }