瀏覽代碼

Fix the generation of alignment instructions for m68k. This not only fixes quite some tests, but most importantly the native m68k compiler!

* aggas.pas, TGNUAssembler.WriteTree.doalign:
    instead of strangely checking for the previous instruction always use .balignw if the previous code was code and we should not use a specific instruction

git-svn-id: trunk@26839 -
svenbarth 11 年之前
父節點
當前提交
0321a77d72
共有 1 個文件被更改,包括 11 次插入21 次删除
  1. 11 21
      compiler/aggas.pas

+ 11 - 21
compiler/aggas.pas

@@ -652,28 +652,18 @@ implementation
               if not(target_info.system in (systems_darwin+systems_aix)) then
               if not(target_info.system in (systems_darwin+systems_aix)) then
                 begin
                 begin
 {$ifdef m68k}
 {$ifdef m68k}
-                  if assigned(lasthp) and
-                      (
-                        (lasthp.typ=ait_instruction) and
-                        (taicpu(lasthp).opcode<>A_JMP)
-                      ) or
-                      (
-                        (lasthp.typ=ait_label)
-                      ) then
+                  if not use_op and (lastsectype=sec_code) then
                     begin
                     begin
-                      if ispowerof2(alignment,i) then
-                        begin
-                          { the Coldfire manual suggests the TBF instruction for
-                            alignments, but somehow QEMU does not interpret that
-                            correctly... }
-                          {if current_settings.cputype in cpu_coldfire then
-                            instr:='0x51fc'
-                          else}
-                            instr:='0x4e71';
-                          AsmWrite(#9'.balignw '+tostr(alignment)+','+instr);
-                        end
-                      else
-                        internalerror(2012102101);
+                      if not ispowerof2(alignment,i) then
+                        internalerror(2014022201);
+                      { the Coldfire manual suggests the TBF instruction for
+                        alignments, but somehow QEMU does not interpret that
+                        correctly... }
+                      {if current_settings.cputype in cpu_coldfire then
+                        instr:='0x51fc'
+                      else}
+                        instr:='0x4e71';
+                      AsmWrite(#9'.balignw '+tostr(alignment)+','+instr);
                     end
                     end
                   else
                   else
                     begin
                     begin