[fpc-devel] Possible idea... "safe" subroutines/methods

Jonas Maebe jonas at freepascal.org
Sun May 5 15:38:29 CEST 2019


On 05/05/2019 15:31, Marģers . via fpc-devel wrote:
>> As mentioned in a previous message, fpc trunk
> supports a volatile
>> intrinsic:
>>
> http://wiki.freepascal.org/FPC_New_Features_Trunk#Support_for_.22volatile.22_intrinsic
> 
> My bad, I didn't know about volatile intrinsic.
> So, does it mean that compiler is allowed to
> optimize any variable, even promote global
> variables to registers, as long they are not in
> volatile(...)?

The compiler would also need to prove that no writes can happen through 
aliases for the duration that they are kept in registers. It has no 
support for this yet.

LLVM does have support for this though, and does perform such 
optimisations on code generated by FPC via the LLVM backend.


Jonas



More information about the fpc-devel mailing list