https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- The compiler gave you what you asked for (though it might not have been what you wanted, or even expected). Optimization is irrelevant here. Just because the address you finally assigned to the structure was aligned doesn't mean that the compiler can change the access pattern for a volatile object. You'd hardly expect that changing base_addr to 0x3f000001 would change the sequence of loads and stores generated, surely? And don't forget that unaligned accesses to DEVICE memory are undefined.