← board

A LongWord against a signed operand compares 32-bit signed on 32-bit targets

Found by the Pascal cross-target differential: test_compare_mixed_signedness, green natively, failed 7 of 28 on i386, arm32 and riscv32.

Resolution (2026-09-28)

Two halves of one rule. TypeCompareUnsigned answers SIGNED for a 4-byte unsigned operand against a signed one (FPC widens the pair to Int64), noting "values are still evaluated in 64-bit registers" -- true on x86-64 and aarch64 only. On the 32-bit targets the pair stayed in 32-bit registers.

Fixture test/test_a_longword_against_a_signed_operand_compares_in_int64.pas (.expected by FPC 3.2.2), and test_compare_mixed_signedness now cross too, in test-core for i386/aarch64/arm32/riscv32.