[fpc-pascal] Lack of 'volatile' a serious issue.

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Dec 19 16:38:32 CET 2015


On 19/12/15 15:58, Tobias Giesen wrote:

> I optimize my code in such a way that compiler optimizations are
> not really needed, but obviously I wouldn't say no if they were
> reliable.
>
> Could it be related to this discussion? Do optimizations make apps
> less thread safe in FPC?

No. The fact that your code works without optimizations and not with 
either means that there's a bug in the optimizer, or that there's a bug 
in your code which happens to be triggered (more reliably) by an 
optimization.

E.g., if you don't initialise a variable somewhere, maybe it's value 
without optimizations (on the stack) happens to be 0 initially, but when 
it's moved to a register (with optimisations) it has another value.


Jonas



More information about the fpc-pascal mailing list