Alright, I could identify the conditions under which this happens, and reproduce the issue on a different machine with an AMD processor, FPC 3.2.2, optimization target processor set to 80386, and level 1 optimisation ON, but no other optimisations. It also happens with fpc 3.0.4., but not with 3.3.1. I don't believe it has actively been fixed in 3.3.1, this may just be random.
Faulty output is:
1
2
3
1
2
3
0
0
0
0
1200
0
@JMarques: You can easily get around this, in the IDE under Options/Compiler/Processor just select some newer processor type for optimization, and the problem should be gone forever.
In the meantime, I'll file a bug report. This is a severe issue and should not happen which such a simple code.