Procházet zdrojové kódy

* x86: Arithmetic combination optimisations are now much more careful about the flags being in use

J. Gareth "Curious Kit" Moreton před 1 rokem
rodič
revize
ebe7bc8097
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      compiler/x86/aoptx86.pas

+ 4 - 3
compiler/x86/aoptx86.pas

@@ -6803,9 +6803,10 @@ unit aoptx86;
 
         SubInstr := (taicpu(p).opcode = A_SUB);
 
-        if GetLastInstruction(p, hp1) and
-           (hp1.typ = ait_instruction) and
-           (taicpu(hp1).opsize = taicpu(p).opsize) then
+        if not RegInUsedRegs(NR_DEFAULTFLAGS, UsedRegs) and
+          GetLastInstruction(p, hp1) and
+          (hp1.typ = ait_instruction) and
+          (taicpu(hp1).opsize = taicpu(p).opsize) then
           begin
             if not (taicpu(p).opsize in [S_B, S_W, S_L{$ifdef x86_64}, S_Q{$endif x86_64}]) then
               { Bad size }