From 52aa40c3b012a9d6625a7cabec705cfd1f19ee4a Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 11 Jan 2018 21:02:39 +0000 Subject: [PATCH] * remove explicit cast to int64 to avoid an internalerror 200706094, resolves #33004 git-svn-id: trunk@37946 - --- .gitattributes | 1 + compiler/x86/nx86mat.pas | 2 +- tests/webtbs/tw33004.pp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw33004.pp diff --git a/.gitattributes b/.gitattributes index a1534730ee..5d3f08105f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15948,6 +15948,7 @@ tests/webtbs/tw3292.pp svneol=native#text/plain tests/webtbs/tw32938.pp svneol=native#text/pascal tests/webtbs/tw3294a.pp svneol=native#text/plain tests/webtbs/tw3298.pp svneol=native#text/plain +tests/webtbs/tw33004.pp svneol=native#text/pascal tests/webtbs/tw3301.pp svneol=native#text/plain tests/webtbs/tw3309.pp svneol=native#text/plain tests/webtbs/tw3320.pp svneol=native#text/plain diff --git a/compiler/x86/nx86mat.pas b/compiler/x86/nx86mat.pas index 4ec105d507..2538067ec5 100644 --- a/compiler/x86/nx86mat.pas +++ b/compiler/x86/nx86mat.pas @@ -412,7 +412,7 @@ interface if (nodetype=divn) and (right.nodetype=ordconstn) then begin - if isabspowerof2(int64(tordconstnode(right).value),power) then + if isabspowerof2(tordconstnode(right).value,power) then begin { for signed numbers, the numerator must be adjusted before the shift instruction, but not wih unsigned numbers! Otherwise, diff --git a/tests/webtbs/tw33004.pp b/tests/webtbs/tw33004.pp new file mode 100644 index 0000000000..6688b86b4a --- /dev/null +++ b/tests/webtbs/tw33004.pp @@ -0,0 +1,14 @@ +program Project1; + +const + Inputs: array[0..2] of QWord = (500, $4563918244F40000,QWord($8AC7230489E80000)); + +var X, Y: QWord; C: Integer; +begin + for C := Low(Inputs) to High(Inputs) do + begin + X := Inputs[C]; + Y := X div QWord($8AC7230489E80000); + WriteLn(X, ' div 10,000,000,000,000,000,000 = ', Y); + end; +end.