Kalle Olavi Niemitalo <kon@xxxxxx> writes: > Compiling the following with Debian g++ 4.4.5-8 on x86_64, using > -m64 -fno-exceptions -O2 -S: > > static volatile char &ref_to_volatile = > *reinterpret_cast<char *>(10000000000); > char > increment_at_ref_to_volatile() > { > return ++ref_to_volatile; > } > > generates code that first reads the reference from memory and > then accesses the volatile char thrice. I see that too with 4.4. However, it appears to be fixed in 4.5. Ian