@Martin_fr I tried to export the assembly but couldn't find a solution.
The asm is only to see what happens.
Afaik there is no solution. Other than hoping that fpc 3.4 (in 2 or 3 years?) will support this. (Or using trunk, when and if this gets implemented)
From what I know (but I am not one of the fpc core team, so this is 2nd hand knowledge) the fact that there is a record, blocks the register optimizer. (despite the value would fit, in 64bit)
NOT tested, but an idea that you could try
var
Accessor: int64; absolute V.P;
May need some syntax fixes....
Maybe that way the compiler can ignore the record, and use a register.... Maybe.
Btw:
So it can be an optimization like it is with 32bit
The 32 bit compilation did not optimize any loop (from what I read).