瀏覽代碼

* cmov cannot use memory location as destination, fixed spiling code, resolves #19201

git-svn-id: trunk@17359 -
florian 14 年之前
父節點
當前提交
66a8dd1e32
共有 3 個文件被更改,包括 18 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 1 0
      compiler/x86/rgx86.pas
  3. 16 0
      tests/webtbs/tw19201.pp

+ 1 - 0
.gitattributes

@@ -11453,6 +11453,7 @@ tests/webtbs/tw1910.pp svneol=native#text/plain
 tests/webtbs/tw1915.pp svneol=native#text/plain
 tests/webtbs/tw1917.pp svneol=native#text/plain
 tests/webtbs/tw1920.pp svneol=native#text/plain
+tests/webtbs/tw19201.pp svneol=native#text/pascal
 tests/webtbs/tw1923.pp svneol=native#text/plain
 tests/webtbs/tw1930.pp svneol=native#text/plain
 tests/webtbs/tw1931.pp svneol=native#text/plain

+ 1 - 0
compiler/x86/rgx86.pas

@@ -191,6 +191,7 @@ implementation
                         { Some instructions don't allow memory references
                           for destination }
                         case instr.opcode of
+                          A_CMOVcc,
                           A_MOVZX,
                           A_MOVSX,
                           A_MULSS,

+ 16 - 0
tests/webtbs/tw19201.pp

@@ -0,0 +1,16 @@
+{ %cpu=i386 }
+{ %opt=-Cppentium3 -Cr }
+program testcmov;
+
+{$mode objfpc}{$H+}
+
+uses
+  Classes, SysUtils;
+var cur,i,resultid, lastNeighbour,firstNeighbour:integer;
+  OldPositions2: array of Integer;
+begin
+ for cur:=lastNeighbour+1 to firstNeighbour do
+   if abs(OldPositions2[cur]-OldPositions2[i]) < abs(OldPositions2[resultId]-OldPositions2[i])  then
+     resultid:=cur;
+end.
+