Fix volatile turning off valid optimizations