2
0
Эх сурвалжийг харах

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

J. Gareth "Curious Kit" Moreton 1 жил өмнө
parent
commit
ebe7bc8097

+ 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 }