瀏覽代碼

* don't do mul->shl optimizations when compiling with overflow checking
* keep operand size sign information in shl/shr

git-svn-id: trunk@3566 -

florian 19 年之前
父節點
當前提交
55962cef95
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      compiler/x86_64/nx64mat.pas

+ 9 - 2
compiler/x86_64/nx64mat.pas

@@ -165,14 +165,21 @@ implementation
           op:=A_SHR;
 
         { special treatment of 32bit values for backwards compatibility }
+        { mul optimizations require to keep the sign (FK) }
         if left.resulttype.def.size<=4 then
           begin
-            opsize:=OS_32;
+            if is_signed(left.resulttype.def) then
+              opsize:=OS_S32
+            else
+              opsize:=OS_32;
             mask:=31;
           end
         else
           begin
-            opsize:=OS_64;
+            if is_signed(left.resulttype.def) then
+              opsize:=OS_S64
+            else
+              opsize:=OS_64;
             mask:=63;
           end;