← board

Bare Eof reads a stale register on xtensa windowed

while not Eof do begin Readln(x); Write(x, ' ') end;
Writeln(Eof);
{ stdin "2\n3\n": FPC and x86-64 print `2 3 TRUE`; xtensa windowed `2 FALSE` }

Cause and fix

The parser lowers bare Eof and Eof() to special call id -210, and each backend calls the builtin unit's PXXStdinEof. In ir_codegen_xtensa.inc the arm was just EmitCallProc. Under Call0 the result is in a2, so that is enough. Under the windowed ABI (call8) the callee's a2 is the caller's a10. The general call path, and each helper that returns a value, moves a10 to a2 afterwards; this arm did not. The arm now does that move when the ABI is windowed.

The other special-call arms in the xtensa backend that call EmitCallProc either return nothing (SetLength, the Readln family) or already move the result.

Measured (2026-09-29, fixedpoint 8c0075b5edd6)