RTOS Simulator Win32

Hi,
I have a working task that runs perfectly with RTOS Win Simulator. When I port this program from Desktop to Laptop it stopped to work correctly.
After that I changed the declaration of a bool variable inside a thread to volatile and now also on laptop it works correct.
Is that a compiler problem?
Best Regards

Quite possibly not. The key is that if something outside that thread can change the variable, and the thread needs to see the change, then the variable needs to be made volatile.

The PC version tends to not have as many registers available, so less opportunity to optimize things and keep them in a register, so missing the volatile might not have caused an issue.

Thanks very much for the reply.
Best regards