I use volatile on memory mapped input ports. It tells the compiler that if I am reading twice from this address without writing to it in between, don't optimize out the subsequent reads because this is not a memory location whose contents are under the control of the program. If the compiler ignores this, the software most certainly will break and break hard. For some applications the results will be crashed vehicles, runaway industrial processes, and dead people. Compilers are not free to ignore volatile and it is not a suggestion to the compiler, it is a directive which must be obeyed. Compilers that don't do this are broken compilers.