volatile access optimization (C++ / x86_64)
DJ Delorie
dj@redhat.com
Mon Jan 5 18:47:00 GMT 2015
> One question: do you have an example of a non-volatile-safe machine so
> I can get a feel for the problems one might encounter? At best I can
> imagine a machine that optimizes "add 0, [mem]" to avoid the
> read/write, but I'm not aware of such an ISA.
For example, the MSP430 backend uses a macro for movsi, addsipsi3,
subpsi3, and a few others, which aren't volatile-safe. Look for
"general_operand" vs "msp_general_operand".
More information about the Gcc
mailing list