3 ms·
I think the compiler still needs to know that the value might be modified from the outside. Otherwise it might optimize the read operation away from the codepat
by notimetorelax 7y ago
I think the compiler still needs to know that the value might be modified from the outside. Otherwise it might optimize the read operation away from the codepath.
- simcop2387 7y agoYou'd have to do all the reads in ASM too then, but it would still be possible. It'd be terrible ergonomically.
- srfilipek 7y agoYes, that is part of creating inline assembly in C or C++ code: http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html