Browse Source

* TX86AsmOptimizer.OptPass1MOVXX takes care of volatility

florian 3 years ago
parent
commit
4610980f2e
1 changed files with 5 additions and 3 deletions
  1. 5 3
      compiler/x86/aoptx86.pas

+ 5 - 3
compiler/x86/aoptx86.pas

@@ -4126,14 +4126,16 @@ unit aoptx86;
                               DebugMsg(SPeepholeOptimization + 'MovXXMovXX2Nop 1 done',p);
                               DebugMsg(SPeepholeOptimization + 'MovXXMovXX2Nop 1 done',p);
                               RemoveInstruction(hp1);
                               RemoveInstruction(hp1);
                               RemoveCurrentp(p); { p will now be equal to the instruction that follows what was hp1 }
                               RemoveCurrentp(p); { p will now be equal to the instruction that follows what was hp1 }
+                              Result:=true;
+                              exit;
                             end
                             end
-                          else
+                          else if (taicpu(hp1).oper[1]^.typ<>top_ref) or (not(vol_write in taicpu(hp1).oper[1]^.ref^.volatility)) then
                             begin
                             begin
                               DebugMsg(SPeepholeOptimization + 'MovXXMovXX2MoVXX 1 done',p);
                               DebugMsg(SPeepholeOptimization + 'MovXXMovXX2MoVXX 1 done',p);
                               RemoveInstruction(hp1);
                               RemoveInstruction(hp1);
+                              Result:=true;
+                              exit;
                             end;
                             end;
-                          Result:=true;
-                          exit;
                         end
                         end
                   end;
                   end;
               end;
               end;