I find the question hard to understand, so I may have missed a subtlety in the code you have shown.
The purpose of volatile memory is to share memory between the current program and an unknown environment. In your exemple, the value of (quit), a boolean reference, is *not* shared, it is the value of (set_quit) that is passed to the environment. So the question *cannot* be about the accesses to the value "quit", which are clearly marked.
One way to rephrase the question would be: "could the compiler assume than (set_quit) will never be called and thus optimize (!quit) to (false)?". I don't see how that could ever be correct, given that the function (set_quit) is passed to an external function.