When cross compiled to linux-x86_64 on Windows 10, the code below produces "8BE6A858 18BE6A858 8B 18B 1 2" instead of "8BE6A858 8BE6A858 8B 8B 1 1". That is to say, temporary value of adding DWORD values is not DWORD. Could you help to comment whether this is a bug ?
{$IFDEF FPC}{$MODE DELPHI}{$ENDIF}
{$IFOPT D+} {$DEFINE DEBUG} {$ENDIF}
{$ASSERTIONS ON}
program DWordBug;
{$IFNDEF FPC}{$APPTYPE CONSOLE}{$ENDIF}
uses SysUtils;
var
A, B, C: DWord;
D: Byte;
E: array [$00..$200] of Byte;
begin
A := $BC48A8EC;
B := $CF9DFF6C;
C := A + B;
D := (A + B) shr 24;
E[$8B] := 1;
E[$18B] := 2;
Writeln(Format('%x %x %x %x %x %x', [C, A+B, D, (A + B) shr 24, E[D], E[(A + B) shr 24]]));
end.