* fixed multiplication by 64-bit constants on x86_64, mantis #26230

git-svn-id: trunk@27822 -
This commit is contained in:
nickysn 2014-05-28 22:52:08 +00:00
parent 2936335f68
commit daf71e6d88
3 changed files with 24 additions and 1 deletions

1
.gitattributes vendored
View File

@ -13931,6 +13931,7 @@ tests/webtbs/tw2602.pp svneol=native#text/plain
tests/webtbs/tw2607.pp svneol=native#text/plain
tests/webtbs/tw26162.pp svneol=native#text/pascal
tests/webtbs/tw2620.pp svneol=native#text/plain
tests/webtbs/tw26230.pp svneol=native#text/plain
tests/webtbs/tw2626.pp svneol=native#text/plain
tests/webtbs/tw2627.pp svneol=native#text/plain
tests/webtbs/tw2631.pp svneol=native#text/plain

View File

@ -1589,7 +1589,7 @@ unit cgx86;
list.concat(taicpu.op_ref_reg(A_LEA,TCgSize2OpSize[size],href,dst));
end
else if (op in [OP_MUL,OP_IMUL]) and (size in [OS_32,OS_S32,OS_64,OS_S64]) and
(a>1) and not ispowerof2(int64(a),power) then
(a>1) and (a<=maxLongint) and not ispowerof2(int64(a),power) then
begin
{ MUL with overflow checking should be handled specifically in the code generator }
if (op=OP_MUL) and (cs_check_overflow in current_settings.localswitches) then

22
tests/webtbs/tw26230.pp Normal file
View File

@ -0,0 +1,22 @@
program tw26230;
const
C1 = 86400000000; //MCS in a day
var
AInput,
Product : Int64;
begin
AInput := 1;
//asm int3 end; //debug trap; `disassemble`
Product := AInput * C1;
WriteLn(AInput, ' * ', C1, ' = ', Product);
if Product <> 86400000000 then
begin
Writeln('Error!');
Halt(1);
end
else
Writeln('Ok');
end.