Browse Source

* i386 version of fix from r21113

git-svn-id: trunk@21127 -
Jonas Maebe 13 years ago
parent
commit
dd03bc3e66
1 changed files with 11 additions and 3 deletions
  1. 11 3
      compiler/i386/popt386.pas

+ 11 - 3
compiler/i386/popt386.pas

@@ -637,12 +637,20 @@ begin
         because it can never be executed}
         because it can never be executed}
                 if (taicpu(p).opcode = A_JMP) then
                 if (taicpu(p).opcode = A_JMP) then
                   begin
                   begin
-                    while GetNextInstruction(p, hp1) and
+                    hp2:=p;
+                    while GetNextInstruction(hp2, hp1) and
                           (hp1.typ <> ait_label) do
                           (hp1.typ <> ait_label) do
                       if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then
                       if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then
                         begin
                         begin
-                          asml.remove(hp1);
-                          hp1.free;
+                          { don't kill start/end of assembler block,
+                            no-line-info-start/end etc }
+                          if hp1.typ<>ait_marker then
+                            begin
+                              asml.remove(hp1);
+                              hp1.free;
+                            end
+                          else
+                            hp2:=hp1;
                         end
                         end
                       else break;
                       else break;
                     end;
                     end;