"Error: Internal error 200706094" when attempting to divide by a large QWord
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
If you attempt to write a program where an unsigned integer division is attempted with a divisor greater than $8000000000000000 (note it compiles fine if it's equal to $8000000000000000), an internal error is consistently raised on the x86_64-win64-win32/win64 build of the compiler. This only happens if the constant is also typecast to a QWord (because the compiler treats it as an Int64 otherwise).
Steps to reproduce:
Write the following program and attempt to compile:
----
program Project1;
const
Inputs: array[0..1] of QWord = (500, $4563918244F40000);
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;
ReadLn();
end.
----
Observe the following error: project1.lpr(11,12) Error: Internal error 200706094
Additional information:
If you don't force the constant to be a QWord with an explicit typecast, it is instead treated as an Int64 and hence the division becomes signed.
Mantis conversion info:
- Mantis ID: 33004
- OS: Windows 7 (64-bit)
- OS Build: Enterprise
- Build: x86_64-win64-win32/win64
- Platform: Win64
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 37946 (#52aa40c3)
- Monitored by: » @CuriousKit (J. Gareth Moreton)