You can use the -Cr and -Ci checks (eg: fpc -Cir program.pas) for overflow and range checks.

There are other checks available in the -C switches too.

The difference might be that fpc and delphi do some different thing when different types are operated on. Eg: "int := int + dword"; might behave differently when it overflows for some reason etc.

I know that recently some Delphi behaviors have been "fixed" in {$mode delphi} to be more delphi compatible. The only sure way to find the difference out is to test it on various values. The -Cir should report if an overflow or range error happens (it quits the program, and if you compiled with -gl it will write the code/line number of the error-causing code)