[fpc-devel] volatile variables

Sven Barth pascaldragon at googlemail.com
Thu Jun 30 15:42:42 CEST 2011

Am 30.06.2011 14:53, schrieb Michael Schnell:
> On 06/30/2011 11:45 AM, Jonas Maebe wrote:
>> There is none. FPC has a "volatile" modifier in svn trunk, but it
>> currently only affects the node tree optimizer.
>> ...
>> Its only use is for memory mapped I/O.
> I don't suppose the node tree optimizer is memory mapped I/O ???

No, but the node tree optimizer might optimize away two consecutive 
reads from or writes to a "memory mapped" variable which might be 
necessary for the hardware...

e.g. (theoretical pseudo code scenario)

=== source begin ===

   a: Integer; volatile; absolute $42;
   b: Integer;
   b := a; // this might be necessary for the hardware, but the 
optimizer will remove the first statement if it doesn't know about 
   b := a;

=== source end ===


More information about the fpc-devel mailing list